-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