Monday, May 23, 2011

Php Code: Mysql result all

There is a PHP function named odbc_result_all which returns the query results in a table. I have frequently found it useful to have the same function for MySQL queries. This function will create a table populated with the data as well as the field names.

Usage:




$result = dbQuery("SELECT * FROM tableName");

mysql_result_all($result);




I am not a PHP master, so any improvement suggestions are welcome.

No comments:

Post a Comment