Hi!
I have this php code which looks like this:
What i want to do is be able to read the next row in the query. So for example:
I almost got the solution , but the very last record for my query is always missing using this code:
Thanks for any help
I have this php code which looks like this:
Code:
$sql = ...... $result = mysql_query($sql,$connection) or die("Couldn't execute SELECT query"); while ($row = mysql_fetch_array($result)) { ...... }
Code:
while ($row = mysql_fetch_array($result)) { ...... if (ID for next row/record = ID for this row/record) { do this } }
Code:
$current_row=mysql_fetch_array($result); //read $current_row while ($next_row = mysql_fetch_array($result)) { //read $next_row ...... if ($current_row['id']==$next_row['id']) { //compare it ..... ..... } $current_row=$next_row; //$next_row become current_row on next step }
Comment