FrankPorter
asked on
mysql_fetch_array
Hi,
Please assist how come when I tried to use "mysql_fetch_array($datase tRemark)" the second time nothing came-up, do we need to reset or move to first record?
I'm trying to access the same dataset that had been used earlier.
Thanks.
//this is only for sample...
while ($row = mysql_fetch_array($dataset Remark))
{
if ($row['RemarkID']=="1"){$C ounta = $Counta + 1;}
}
echo $Counta;
//2nd time accessing
while ($row = mysql_fetch_array($dataset Remark))
{
if ($row['RemarkID']=="1"){$C ountb = $Countb + 1;}
}
echo $Countb;
Please assist how come when I tried to use "mysql_fetch_array($datase
I'm trying to access the same dataset that had been used earlier.
Thanks.
//this is only for sample...
while ($row = mysql_fetch_array($dataset
{
if ($row['RemarkID']=="1"){$C
}
echo $Counta;
//2nd time accessing
while ($row = mysql_fetch_array($dataset
{
if ($row['RemarkID']=="1"){$C
}
echo $Countb;
ASKER
VoteyDisciple,
Thanks very much for the info, would you happen to know how can we use $rows[] in our second condition?
how would the code look like ?
//2nd time accessing
...
...
Thanks very much for the info, would you happen to know how can we use $rows[] in our second condition?
how would the code look like ?
//2nd time accessing
...
...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you're interested in keeping all the rows around, consider something like...
while ($row = mysql_fetch_aray($datasetR
$rows[] = $row;
(so you'll end up with an array $rows that contains each row).