Re: Output HTML, or just a handle? - Mailing list pgsql-novice

From Sean Davis
Subject Re: Output HTML, or just a handle?
Date
Msg-id 002b01c50282$60d39450$7d75f345@WATSON
Whole thread Raw
In response to Output HTML, or just a handle?  ("Rodolfo J. Paiz" <rpaiz@simpaticus.com>)
List 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@simpaticus.com>
To: <pgsql-novice@postgresql.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@simpaticus.com>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>



pgsql-novice by date:

Previous
From: Alexander Borkowski
Date:
Subject: Re: Formatting a month in query output
Next
From: Alexander Borkowski
Date:
Subject: Re: Output HTML, or just a handle?