Jump to content


Photo

nested while loops with EOF


  • Please log in to reply
No replies to this topic

#1 ruzz311

ruzz311
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 14 April 2006 - 09:39 PM

I'm trying to loop through, basically like a 2d array, and check some values against each other. Maybe the best thing is to show you what i'm talking about

<?php
while(!$rs_MenuItems->EOF){
while(!$rs_Items->EOF){
if($rs_MenuItems->Fields('iItemID') == $rs_Items->Fields('iRecID')){
echo $rs_Items->Fields('tMenu_ItemName')." : ".$rs_Items->Fields('tMenu_ItemDesc')."<br>";
}
$rs_Items->MoveNext();
}
$rs_MenuItems->MoveNext();
}
?>

I'm trying to loop through the $rs_Items recordset for each menuItem, however it only shows for the first MenuItem entry.

I've tried putting a pointer after the $rs_Items loop that points too "$rs_Items->MoveFirst();" I was hoping this would kickstart the recordset over and would work the way i want it too, but instead it just repeats the Items Recordset about 50 times and then continues on with out an error. Can anyone help me out, I just started using php this semester.

®u§§311




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users