|  | Posted by deko on 02/27/07 22:09 
> ezSQL aside, I think the issue is removing an item from an object in PHP
 I tried this:
 
 foreach ($category as $cat_item)
 {
 echo $cat_item->cat_name;
 foreach ($itemdata as $item_datum)
 {
 if ($item_datum->category_id == $cat_item->cat_id)
 {
 echo '--'.$item_datum->item_name;
 array_splice($itemdata, current($itemdata), 1);
 }
 }
 };
 
 which sees to work, but not accurately... if the matched item_datum is the first
 in the array, the second element is removed.
  Navigation: [Reply to this message] |