我在数据库中有一个 testField
testField = NULL
我跑了一个查询:
$query = mysql_query("SELECT testField FROM table");
$result = mysql_fetch_array($query);
我尝试了不同的方法来避免出错。但我仍然收到“未定义变量”错误。
if(isset($result['testField'])){$testField = "OK"; echo $testField};
if(!empty($result['testField'])){$testField = "OK"; echo $testField};
if($result['testField']=='1'){$testField = "OK"; echo $testField};
请帮忙。谢谢!