(PHP 4 >= 4.2.0, PHP 5, PHP 7)
pg_field_is_null — 锟斤拷锟斤拷锟街讹拷锟角凤拷为 NULL
pg_field_is_null() 锟斤拷锟斤拷锟街讹拷锟角凤拷为 NULL
锟斤拷锟斤拷锟斤拷侄锟斤拷诟锟斤拷锟斤拷锟斤拷锟斤拷锟轿� NULL
锟津返伙拷 1锟斤拷锟斤拷锟斤拷侄锟斤拷诟锟斤拷锟斤拷锟斤拷锟斤拷胁锟斤拷锟� NULL
锟津返伙拷 0锟斤拷锟街段匡拷锟斤拷锟斤拷锟叫碉拷锟斤拷锟斤拷锟脚o拷锟斤拷锟街o拷锟斤拷式锟斤拷锟斤拷锟斤拷也锟斤拷锟斤拷锟斤拷锟街讹拷锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷式锟斤拷锟斤拷锟斤拷锟叫的憋拷糯锟� 0 锟斤拷始锟斤拷
Example #1 pg_field_is_null() 锟斤拷锟斤拷
<?php
$dbconn = pg_connect("dbname=publisher") or die ("Could not connect");
$res = pg_query($dbconn, "select * from authors where author = 'Orwell'");
if ($res) {
if (pg_field_is_null($res, 0, "year") == 1) {
echo "The value of the field year is null.\n";
}
if (pg_field_is_null($res, 0, "year") == 0) {
echo "The value of the field year is not null.\n";
}
}
?>
Note:
锟斤拷锟斤拷锟斤拷锟斤拷前锟斤拷锟斤拷锟斤拷为 pg_fieldisnull()锟斤拷