Jump to content

Archived

This topic is now archived and is closed to further replies.

jaymc

While & Fetch Array

Recommended Posts

Right, im having trouble getting to while loops to work in the same script. here is the syntax of the while loop


[code]while ($resultsa = mysql_fetch_array($runquerya)) {
echo $resultsa[FROM];
}[/code]

[code]while ($resultsb = mysql_fetch_array($runqueryb)) {
echo $resultsb[TO];
}[/code]

$runqueryb/$runquerya is the result of a MYSQL query which Im sure is obvious.

The problem is, the second While loop does not work/execute/proceed...

Im just wondering why. Is it a fault with my code? Or can you only call a while loop or array fetch once?

Any help would be great

Share this post


Link to post
Share on other sites
Edit

Actually, I think I might know the problem...

Once a variable has had the array fetch from it, does that variable then become empty meaning it cant be used again to retrieve the array?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.