<?php
foreach($products as $product){
//some code here , echoing products and everything works there
foreach($types as $type){
echo $type['type'];
// only does the echo on the first occurence of this "types" loop
}
}
?>
Hi everyone,
I'm making a type of form in order to allow people, for each product of the database, to specify the type of the product.
$products and $types are both distinct arrays. Products contains all my products and $types contains all my types.
Actually I have only 2 products and 2 types.
So, my question is: Why the echo doesn't show anything for the second occurence of the foreach($products as $product)
, and show the good results at the first occurence?
This is exactly the same array, called 2 times, but working only at the first occurence of the loop. Very Strange for me.
Hope you'll understand despite my poor english. Bye