Using the Mysql_fetch_row function to query the results of the database, display only the results of interlaced in the database, rather than the full result, excuse me for what reason? The code is as follows:
while(mysql_fetch_row($result)){ echo ''; print_r(mysql_fetch_row($result)); echo '
';}
This code can only show part of the results,
Database:
2, use the following code to query all the results, why?
while($arr = mysql_fetch_row($result)){ echo ''; print_r($arr); echo '
';}
Reply content:
Using the Mysql_fetch_row function to query the results of the database, display only the results of interlaced in the database, rather than the full result, excuse me for what reason? The code is as follows:
while(mysql_fetch_row($result)){ echo ''; print_r(mysql_fetch_row($result)); echo '
';}
This code can only show part of the results,
Database:
2, use the following code to query all the results, why?
while($arr = mysql_fetch_row($result)){ echo ''; print_r($arr); echo '
';}
It should be mysql_fetch_row ($result) Move the pointer back one after each execution
The first time is executed in parentheses after the while, no output
Then the code block executes once and outputs
And then loop the execution again without output
Then the code block executes once and outputs
Then the condition in the while is false, stop
Each fetch is equivalent to moving the pointer down one bit, the first one to move down two bits each time (while inside once, print_r inside once), so every other output.