note 93917 deleted from function.mysql-result by philip
| From: | philip@php.net | Date: | Fri, 04 Sep 2015 22:03:04 +0000 |
| Subject: | note 93917 deleted from function.mysql-result by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203697@lists.php.net to get a copy of this message | ||
Note Submitter: DJK
----
Note that mysql_result affects the internal pointer used by mysql_fetch_*
<?php
$res = mysql_query('SELECT a,b FROM ab');
echo mysql_result($res,0,0);
print_r(mysql_fetch_assoc($res));
?>
In the above example, the call to mysql_fetch_assoc would return the SECOND result, not the first as
(I) expected.
Use mysql_data_seek($res,0) to reset the result set.