How can I check the value of the Next Row while looping using PHP/MYSQL?
<p>I got previousRow of record using this code</p>

<pre><code>&lt;?php
  $previousRow = array();
  while ($temp = mysql_fetch_row($res2)) 
 {

     echo "&lt;br&gt;currentRow:".$temp[1];
     echo "previousRow:".$previousRow[1];
     $previousRow = $temp; 

  } 
 ?&gt;
</code></pre>

<h2>oupout</h2>

<p>currentRow:1previousRow: </p>

<p>currentRow:5previousRow:1 </p>

<p>currentRow:6previousRow:5 </p>

<p>currentRow:7previousRow:6 </p>

<p>currentRow:8previousRow:7</p>

<p>How can I check the value of the next row replaced by Previous Row ?</p>

<p>Any help would be grateful.</p>
