while
ループは、値の最初のレコードに対してのみ機能しますforeach
。理由がわかりませんでした。どんな助けでも大歓迎です。
foreach($country_array as $country_new)
{
$result=mysql_query("select product.product_id,product.product_name from product left join country_iso_telcode on product.country=country_iso_telcode.country_name left join product_category_listing on product.product_id=product_category_listing.product_id where product.product_name REGEXP '[[:<:]]$search' and country_iso_telcode.region='$region' and product.country='$country_new'")or die("wrong query in search results displaying button results");
while($row=mysql_fetch_array($result))
{
$product_id=$row['product_id'];
$product_name=$row['product_name'];
}
}