我正在运行下面的代码来回显 MySQL 数据库中单行的内容,它当前输出的内容似乎是输出的两倍。见下文
$result = mysql_query("SELECT * FROM table WHERE this='1'") or die(mysql_error());
$row = mysql_fetch_array($result);
foreach($row as $key => $field) {
if($key != 'id' && $key != 'doss' && $key != ''){
echo "Field name: $key = $field<br />";
$missing =$missing+$field;
}
}
输出是:
Field name: 1 = 0
Field name: go = 0
Field name: 2 = 1
Field name: het = 1
Field name: 3 = 0
Field name: quf = 0
Field name: 4 = 0
Field name: sid = 0
Field name: 5 = 1
Field name: ram = 1
Field name: 6 = 1