Jump to content


Photo

While & Fetch Array


  • Please log in to reply
1 reply to this topic

#1 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 21 October 2006 - 02:46 PM

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


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

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

$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

I would love to change the world, but they won't give me the source code

SEO Agency

#2 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 21 October 2006 - 02:54 PM

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?
I would love to change the world, but they won't give me the source code

SEO Agency




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users