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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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