New function for sql portability: sql_isnull().

NOTE: I don't know how this is supposed to be phrased in Postgres. Can
someone who does give a finger of help here? :)
This commit is contained in:
defacer
2005-03-07 16:58:00 +00:00
parent ff2fc9e22d
commit a0413b585d
+15
View File
@@ -2831,5 +2831,20 @@ function sql_fullname($firstname='firstname',$lastname='lastname') {
}
}
/**
* Returns the proper SQL to do IS NULL
*
*/
function sql_isnull($fieldname) {
global $CFG;
switch ($CFG->dbtype) {
case 'mysql':
return $fieldname.' IS NULL';
default:
return $fieldname.' IS NULL';
}
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
?>