while($row = mysql_fetch_array($query)) doesn't work in second time
问题 I have: $query = mysql_query("SELECT ... "); while($row = mysql_fetch_array($query)) { first time used; } ... while($row = mysql_fetch_array($query)) { second time used; } In second time it doesn't work. Why? 回答1: That's because the internal data pointer has reached its end. To reread the query, either rewind the pointer with mysql_data_seek() , or reissue the query. 回答2: A MySQL result resource has an internal pointer, much like a PHP array, and when you have run through it once, the pointer