I have a mysql recordset below:
PHP Code:
$qryRsltT0 = mysql_query($barryq,$dblinkT0);
while ($row = mysql_fetch_array($qryRsltT0)){
$pcount++;
mysql_data_seek($qryRsltT0,$q);
echo $row['name'];
if ($pcount==2) {break;}
}
This returns:
Person A
Person B
Person C
Person D
Those are all 4 of my records. However, using mysql_data_seek, the first loop of returning the recordset always chooses the first record, and then gets the $q index correct after the first loop
PHP Code:
$pcount=0;
$q=2;
$qryRsltT0 = mysql_query($barryq,$dblinkT0);
while ($row = mysql_fetch_array($qryRsltT0)){
$pcount++;
mysql_data_seek($qryRsltT0,$q);
echo $row['name'];
if ($pcount==2) {break;}
}
This returns:
Person A
Person C
How would I make the first round of looping correct to get it to pick the $q index?