php循环输出数组 不能读取,该如何解决

WBOY
Release: 2016-06-13 12:20:02
Original
1090 people have browsed it

php循环输出数组 不能读取
$cart = mysql_query("select * from  qiyu_cart where cart_order=410010268");
while($row11=mysql_fetch_array($cart)){
$cart1 = mysql_query("select * from  qiyu_food where food_id=".$row11['cart_food']);
$row1=mysql_fetch_array($cart1);
$arr= array($row1['food_name']."
"
);
echo $arr."
";
}
我想做出输出一组数据,
$arr.输出的如果怎么是array  而不是$row1['food_name'].的内容  是哪里错了吗。?
------解决思路----------------------
$arr= array($row1['food_name']."
"
应为
$arr[] = array($row1['food_name'])

$arr .= $row1['food_name']. "
";

echo $arr."
";
应为
echo join('
' $arr) ."
";

echo $arr."
";

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!