-2
$resturant_category_product_query = "SELECT * FROM bb_product p WHERE p.resturant_category_id ='$resturant_category_id'";
foreach ($resturant_category_product_query as $resturant_category_product) {
$resturant_category_product_data[] = array(
'resturant_category_id' =>$resturant_category_product['resturant_category_id'],
);
}
你只需要看看[mysqli](http://php.net/manual/it/book.mysqli.php)的文檔,或者一些教程。 – Federkun
如何獲得$ resturant_category_product_data []值 – Hitesh
您需要執行查詢,然後檢索每個返回的行。你的代碼只是爲查詢字符串設置一個變量,然後嘗試將該字符串視爲一個數組。 – Kickstart