Jump to content

nested while loops with EOF


ruzz311

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/7439-nested-while-loops-with-eof/
Share on other sites

Archived

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

×
×
  • Create New...

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.