note 13203 deleted from function.mysql-result by irc-html
| From: | irc-html@php.net | Date: | Sun, 14 Apr 2002 00:16:00 +0000 |
| Subject: | note 13203 deleted from function.mysql-result by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-29245@lists.php.net to get a copy of this message | ||
Here's how you use mysql_result() in order to show ALL fields returned from a query followed by
their values:
$dbcnx = mysql_connect("localhost", "root", "");
$result = mysql_query("SELECT * from users",$dbcnx);
for ($i = 0; $i<mysql_num_fields($result); $i++)
echo mysql_field_name($result, $i)." -
".mysql_result($result,0,$i)." // ";