在mysql_fetch_assoc($ result)之后$ result不可用,为什么

i get data from sql then run while ($list = mysql_fetch_assoc($result)) { ... }

then i try to do the same thing but its giving nothing like result is empty does using mysql_fetch_assoc() clears $request variable?

The function keeps a counter, so of course you can't keep using it when it's gotten to the end. Is there a particular reason for looping through it twice? Anyways:

mysql_data_seek($request, 0);

Is what you need before the second loop.

You've hit the end of $result resurce using while loop. To solve this, rewind your pointer back to 0 position when you want to use your resource again... look at mysql_data_seek() function for more info.

mysql_fetch_assoc itself doesn't know when you are and are not calling it in a while loop. It doesn't magically reset to the start of the resultset when you use it in a separate loop.

Reset it to the start of the resultset with mysql_data_seek once you've reached the end and want to go back to the beginning... or, ideally, remove your need to iterate the results twice.