以下是代码:
$query = mysql_query("SELECT * FROM tablex");
if ($result = mysql_fetch_array($query)){
if ($result['column'] == NULL) { print "<input type='checkbox' />"; }
else { print "<input type='checkbox' checked />"; }
}
Run Code Online (Sandbox Code Playgroud)
如果值NOT NULL仍然是我仍然得到uncheked框.我从上面做错了什么,干什么$result['column'] == NULL工作?
有任何想法吗?
The*_*man 82
使用is_null或===operator.
is_null($result['column'])
$result['column'] === NULL
Run Code Online (Sandbox Code Playgroud)
怎么样使用
if (empty($result['column']))
| 归档时间: |
|
| 查看次数: |
125125 次 |
| 最近记录: |