endless while loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux