-2
我在下面得到了这段代码,它显示了我刚刚得到的第一个数组结果。它怎么能让我看到他们呢?Echo all array results
$res = mysql_query("SELECT clients FROM area ORDER BY date") or die("Error: " . mysql_error());
while($row = mysql_fetch_array($res)){
foreach($row as $value){
$result = explode(",", $value);
foreach($result as $newvalue){
$query="SELECT clients FROM names where names.id='$newvalue'";
$res2 = mysql_query($query);
$r = mysql_fetch_array($res2);
$parent = $r['clients'];
}
}
// echo part
echo "<td>" . $parent . "</td>";
}
此外,我想呼应区域名称和日期,但是当我做选择*和回声名称和日期我什么都没有。
谢谢
请阅读本关于MySQL扩展 - http://stackoverflow.com/questions/12859942/why-shouldnt-i -use-mysql-functions-in-php#回答#12860140 – Phil 2013-03-04 02:46:53
可能重复[从mysql获取多行输出](http://stackoverflow.com/questions/15055037/fetch-multiple-row-output-from-mysql ) – 2013-03-04 02:47:48
感谢您的答复,但我仍然无法得到所有结果从阵列 – jak 2013-03-04 02:57:32