|
Posted by Gunter Sammet on 01/05/05 23:17
Hi all:
I am having some trouble getting the following code to work:
if (is_array($bundle_attributes)) {
reset($bundle_attributes);
while (list($option, $value) = each($bundle_attributes)) {
reset($value);
while (list($option2, $value2) = each($value)) {
$this->contents[$products_id]['attributes'][$option] = $value;
if (tep_session_is_registered('customer_id')) tep_db_query("insert into " .
TABLE_CUSTOMERS_BASKET_BUNDLE_ATTRIBUTES . " (customers_id, products_id,
sub_product_id, products_options_id, products_options_value_id) values ('" .
(int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $option .
"', '" . (int)$option2 . "', '" . (int)$value2 . "')");
}
}
}
}
It gives me an endless loop in the second while loop. It seems like it
doesn't move the pointer to the next value in the $option array. When I do a
print in that loop, I am getting the key value pair for the first element in
the $option array. Changing it to a for loop works. Any ideas why this
happens?
TIA
Gunter
Navigation:
[Reply to this message]
|