note 13431 added to ref.mysql.php
| From: | jpaulo at medbase dot com dot br | Date: | Sat, 16 Jun 2001 07:24:26 +0000 |
| Subject: | note 13431 added to ref.mysql.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-14301@lists.php.net to get a copy of this message | ||
Another quick and simple example which extracts the reslults as variables. Just don't know how
fast it is compared with extract, anyway here is:
$result = mysql_query("select id, name, address, occ from table");
// Assign the variables into the array:
while(list($id, $name, $address, $occ) = mysql_fetch_row($result)) {
//Now do what you want:
echo "<table width=\"80%\"><tr>\n"
."<td><a class=\"main\"
href=\"users.php?id=$id\">$name</a></td>"
."<td>$address</td><td>$occ</td>\n"
." </tr></table>\n";
}
Best Regards!
João Paulo M. Fischer
http://www.php.net/manual/en/ref.mysql.php