Could somebody tell me why the top section works as it should while the bottom section continually loops? The bottom should loop one time more than desired, but, although it doesn't really matter anymore, it bugs me that I can't figure out why it actually loops forever. The only difference there should be between these two versions of the same loop is that one is a do..while loop and one is a while loop. Please tell me it's a bug and I'm not an idiot.
$cInfo=mysql_fetch_assoc($result);
while($cInfo){
if($cInfo['type']='category'){
$this->subCats[]['name']=$cInfo['name'];
$this->subCats[]['description']=$cInfo['description'];
}
if($cInfo['type']='item'){
$this->items[$cInfo['name']]=new Item;
$this->items[$cInfo['name']]->id=$cInfo['name'];
$this->items[$cInfo['name']]->getItem();
}
$cInfo=mysql_fetch_assoc($result);
}
do{
$cInfo=mysql_fetch_assoc($result);
if($cInfo['type']='category'){
$this->subCats[]['name']=$cInfo['name'];
$this->subCats[]['description']=$cInfo['description'];
}
if($cInfo['type']='item'){
$this->items[$cInfo['name']]=new Item;
$this->items[$cInfo['name']]->id=$cInfo['name'];
$this->items[$cInfo['name']]->getItem();
}
}while($cInfo);