note 26973 added to function.mysql-fetch-object
| From: | allen at rack1 dot php dot net | Date: | Tue, 19 Nov 2002 10:14:55 +0000 |
| Subject: | note 26973 added to function.mysql-fetch-object | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39688@lists.php.net to get a copy of this message | ||
I found the above code to be buggy, not adding all the records to the array. This is the code I used
instead:
$command = "SELECT * FROM table ";
$result = mysql_query($command, $link_id);
$num = mysql_num_rows($result);
$clickthru = array();
for ($i = 0; $i <= $num; $i++) {
$clickthru[$i] = array();
$clickthru[$i] = mysql_fetch_array($result);
}
Allen
--
http://www.php.net/manual/en/function.mysql-fetch-object.php
http://master.php.net/manage/user-notes.php?action=edit+26973
http://master.php.net/manage/user-notes.php?action=delete+26973
http://master.php.net/manage/user-notes.php?action=reject+26973