如何使用phpMyDataGrid选择sql表的空值

如何使用phpMyDataGrid选择sql表的空值,php,mysql,null,where-clause,Php,Mysql,Null,Where Clause,在我最后一年的php项目中,我使用了phpMyDataGrid生成报告。如何使用phpMyDataGrid选择空列?我的表和代码如下 vehicle_license 6606621252 5965565553 NULL 6656771252 NULL 5345565553 NULL 6609877252 2345565553 4566521252 5964564563 /* Define fields to show */ $objGrid -> FormatColumn("

在我最后一年的
php
项目中,我使用了
phpMyDataGrid
生成报告。如何使用
phpMyDataGrid
选择空列?我的表和代码如下

vehicle_license 
6606621252 
5965565553 
NULL
6656771252 
NULL
5345565553
NULL
6609877252 
2345565553
4566521252 
5964564563

/* Define fields to show */
$objGrid -> FormatColumn("regno", "Registration No", 5, 2, 0, "130", "left");
$objGrid -> FormatColumn("availability", "Registration status", 2, 2, 0,"50", "left", "check:Unavailable:Registered");
$objGrid -> FormatColumn("officerid", "Officer", 5, 2, 0, "130", "left");
$objGrid -> FormatColumn("datetime", "Data & Time", 5, 2, 0, "180", "left", "time:dmy:/");
$objGrid -> orderby("datetime", "DESC");

/* Records can be filtered to comply with a pre-defined condition */
$objGrid -> where ("driving_license = NULL");  //not working
$objGrid -> where ("driving_license = 'NULL'");  //not working
$objGrid -> where ("driving_license = 'IS NULL'");  //not working
//<> operator for 'not equal' is working
车辆牌照
6606621252
5965565553
无效的
6656771252
无效的
5345565553
无效的
6609877252
2345565553
4566521252
5964564563
/*定义要显示的字段*/
$objGrid->FormatColumn(“regno”、“注册号”、5、2、0、“130”、“左”);
$objGrid->FormatColumn(“可用性”、“注册状态”、2、2、0、“50”、“左侧”、“检查:不可用:已注册”);
$objGrid->FormatColumn(“officerid”、“Officer”、5、2、0、“130”、“left”);
$objGrid->FormatColumn(“日期时间”、“数据和时间”、5、2、0、“180”、“左”、“时间:dmy:/”);
$objGrid->orderby(“datetime”,“DESC”);
/*可以筛选记录以符合预定义的条件*/
$objGrid->where(“驾驶执照=NULL”)//不起作用
$objGrid->where(“驾驶执照='NULL'”//不起作用
$objGrid->where(“驾驶执照=‘为空’”)//不起作用
//“不相等”的运算符正在工作


试试驾驶执照是空的是正确的..工作..:)thanxI不知道你在用什么数据库,但是MySQL处理空的很容易。你可以在这里了解更多。
where ("driving_license IS NULL");
where ("driving_license = '' ");