note 22115 added to function.msql-fetch-array
| From: | daevid at daevid dot com | Date: | Fri, 07 Jun 2002 07:05:25 +0000 |
| Subject: | note 22115 added to function.msql-fetch-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31552@lists.php.net to get a copy of this message | ||
$result = mysql_query("SELECT name, email, url FROM mytable where id = 42", $linkid);
if (!$result) { echo mysql_errno().": ".mysql_error()."\n"; exit; }
if (mysql_num_rows($result) == 1)
{
$row = mysql_fetch_array($result,MYSQL_ASSOC);
while(list($myVariableName,$sqlFieldName)=each($row)) { $$myVariableName = $sqlFieldName; }
}
//now all the data for row 42 is in $name, $email, $url
--
http://www.php.net/manual/en/function.msql-fetch-array.php
http://master.php.net/manage/user-notes.php?action=edit+22115
http://master.php.net/manage/user-notes.php?action=delete+22115
http://master.php.net/manage/user-notes.php?action=reject+22115