|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-16 09:48 UTC] georg@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 10:00:01 2025 UTC |
Description: ------------ mysql_fetch_assoc somehow caches results. Reproduce code: --------------- $results = mysql_query("select id,datein,dateout,rnumber from repairrecords limit 1800,100"); echo "<table align=center><form action=fixdate.php method=post>"; while($tmp = mysql_fetch_assoc($results) ) { <tr> <td> $tmp[id] <input type=hidden name=\"cpid$x\" value=\"$tmp[pid]\"> <input type=hidden name=\"cid$x\" value=\"$tmp[id]\"> <input type=hidden name=\"crnumber$x\" value=\"$tmp[rnumber]\"> </td> <td><input type=text name=\"datein$x\" value=\"".$tmp['datein']."\"></td> <td><input type=text name=\"dateout$x\" value=\"".$tmp['dateout']."\"> ($tmp[rnumber])</td> </tr> } Expected result: ---------------- when you change limit in the query from 1800,100 to 1900,100 It gives you the last 100 results. HOWEVER, if you do print_r($tmp) inside of the while loop it works. This does not happen every time. When it does happen, it continues to give the wrong results. Makes no sense to me.