mengzc
2018-05-12 00:00:42 +08:00
完整代码:
foreach ($user_server_ip as $key => $value) {
$sqlserver = "SELECT `server_name`,`server_ip` FROM server WHERE `id` = ".$value.";";
$results_user_server_ip = mysql_query($sqlserver);
while ($row_user_server_ip = mysql_fetch_array($results_user_server_ip))
{
echo "[".$row_user_server_ip['server_name']."]";
echo $row_user_server_ip['server_ip'];
echo "<br>";
}
}
第 6 行 原来的是:echo "<".$row_user_server_ip['server_name'].">"; 为了对输出的值外左右加一个<>,结果测试有问题。所以换成了[ ]后正常。