Re: php/mysql Query Question.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



admin@xxxxxxxxxxxxxxxxxxx wrote:
> Before most of you go on a rampage of how to please read below...
> 
> As most of you already know when using MySQL from the shell you can write your queries in html format in an out file.
> 
> Example:   shell>mysql -uyourmom -plovesme --html
> This now will return all results in an html format from all queries.
> 
> Now I could “tee” this to a file and save the results returned if I so choose to save the result of the display .
> 
> Let’s say I want to be lazy and write a php MySQL query to do the same so that any result I queried for would return the html results in a table without actually writing the table tags in the results.
> 
> Is there a mysql_connect or select_db or mysql_query tag option to do that since mysql can display it from the shell?

I think you'll find that the HTML output is a function of the mysql command line
program (I tend to use PostgreSQL, where 'psql' is a similar program) so you can
only access that functionality by calling the command line.

I suspect that, since PHP is a HTML processing language (originally), the
creators of the mysql_ functions figured that the user could sort out making
HTML from the data returned...

It's should be a simple operation to write a wrapper function to put HTML around
the results. There might even be a PEAR extension or PHPClasses class to do it
(I haven't looked yet)

-- 
Peter Ford                              phone: 01580 893333
Developer                               fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux