Re: Output HTML, or just a handle?
От | Jason Dixon |
---|---|
Тема | Re: Output HTML, or just a handle? |
Дата | |
Msg-id | AF0E9132-6E77-11D9-8CFE-000D93C63BA8@dixongroup.net обсуждение исходный текст |
Ответ на | Output HTML, or just a handle? ("Rodolfo J. Paiz" <rpaiz@simpaticus.com>) |
Список | pgsql-novice |
On Jan 24, 2005, at 8:47 PM, Rodolfo J. Paiz wrote: > Hi! > > Looking for "best practices" here. I've just seen that psql can output > a > query to an HTML file. If I am creating a query within a web page, is > it > generally recommended to get HTML output from PostgreSQL? If so, where > can I learn about how to put this in a query and how to control it with > finer-grained detail as regards column borders, fonts, etc? I haven't used this much personally, so I'm probably not qualified to give my two cents. Of course, that's never stopped me before... I believe this is just for outputting tables. Looking at \?, I see that you can alter the HTML tag attributes with \T. However, there's just something about dumping tables to a browser that feels... wrong. Maybe that's just my paranoia speaking. *shrug* If PHP is what you're leaning towards (Perl!), then I would stick with the PHP database handles. Keep your presentation to the HTML and your SQL to the database. > Or is it recommended to just run the bare query, then use PHP on my > webpage to loop through the resulting output table handle and create > the > table there? And if so, just so I don't reinvent the wheel more than > once a day, can someone point me to any code snippets previously > written > on this? (That I can legally use, of course...) This gets my vote. -- Jason Dixon DixonGroup Consulting http://www.dixongroup.net
В списке pgsql-novice по дате отправления: