(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
pg_field_is_null — 测试字段是否为 SQL NULL
resultPgSql\Result 实例,由 pg_query()、pg_query_params() 或者 pg_execute()(等)返回。
row要获取的结果中的行号。行从 0 向上编号。如果省略或,则获取当前行。
field
   如果指定行中的字段为 SQL NULL,则返回 1,否则返回 0。如果该行超出范围或发生任何其他错误,则返回 false。
  
| 版本 | 说明 | 
|---|---|
| 8.3.0 | row现在可为 null。 | 
| 8.1.0 | 现在 result参数接受 PgSql\Result
  实例,之前接受 resource。 | 
示例 #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";
    }
 }
?>