Skip site navigation (1) Skip section navigation (2)

Re: Output HTML, or just a handle?

From: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
To: "Rodolfo J(dot) Paiz" <rpaiz(at)simpaticus(dot)com>,<pgsql-novice(at)postgresql(dot)org>
Subject: Re: Output HTML, or just a handle?
Date: 2005-01-25 02:05:44
Message-ID: 002b01c50282$60d39450$7d75f345@WATSON (view raw or flat)
Thread:
Lists: pgsql-novice
I think psql adds the HTML and so isn't available via SQL.  In general, I 
think "best practice" is to keep the database information separate from the 
view of it (HTML is an example of a view of the data, but only one example). 
As for reinventing the wheel, PHP is written to do just this (among other 
things, but database access and display is by far the most common use, I 
suggest without proof).  Any book worth half its weight will have such 
examples.  Also, there are several websites devoted to this kind of thing. 
Here is one from the top of a google search:

http://www.onlamp.com/pub/a/onlamp/2002/01/24/postgresql.html

Sean

----- Original Message ----- 
From: "Rodolfo J. Paiz" <rpaiz(at)simpaticus(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Sent: Monday, January 24, 2005 8:47 PM
Subject: [NOVICE] Output HTML, or just a handle?


> 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?
>
> 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...)
>
> Thanks for any advice. I promise not to post more questions tonight. :-)
>
> Cheers,
>
> -- 
> Rodolfo J. Paiz <rpaiz(at)simpaticus(dot)com>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> 



In response to

pgsql-novice by date

Next:From: Alexander BorkowskiDate: 2005-01-25 02:06:18
Subject: Re: Formatting a month in query output
Previous:From: Ramon OrticioDate: 2005-01-25 02:03:13
Subject: recommended programming language for postgresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group