ScottCybak
Programmer
Hi, i'm trying to cycle through an array of query results. The query has 4 fields
$Sql = "SELECT.. blah blah ";
$Result = mysql_query($Sql);
$Rst = mysql_fetch_array($Result);
Now, i know i can cycle through the rst on the fly using a While (x = fetch_array blah blah) BUT, i want to do this afterwards
Normally, i reference it while i'm looping via $Rst['fieldName'] BUT, i can't figure out how to reference it while i'm in a foreach loop..
basically, i want to say:
foreach ($Rst['fieldName'] as $x) {
echo $x;
}
but am unsure of syntax. TIA! Scott Cybak
scott@athree.com
$Sql = "SELECT.. blah blah ";
$Result = mysql_query($Sql);
$Rst = mysql_fetch_array($Result);
Now, i know i can cycle through the rst on the fly using a While (x = fetch_array blah blah) BUT, i want to do this afterwards
Normally, i reference it while i'm looping via $Rst['fieldName'] BUT, i can't figure out how to reference it while i'm in a foreach loop..
basically, i want to say:
foreach ($Rst['fieldName'] as $x) {
echo $x;
}
but am unsure of syntax. TIA! Scott Cybak
scott@athree.com