pg_field_is_null

基本介紹

  • 外文名:resource result, int row, mixed field
  • 含義:測試欄位是否為 NULL
  • 領域:計算機
  • 內容:pg_field_is_null
pg_field_is_null,說明,

pg_field_is_null

(PHP 4 >= 4.2.0)
pg_field_is_null -- 測試欄位是否為 NULL

說明

int pg_field_is_null ( resource result, int row, mixed field)
pg_field_is_null() 測試欄位是否為 NULL。如果欄位在給出的行中為 NULL 則返回 1,如果欄位在給出的行中不是 NULL 則返回 0。欄位可以以列的索引號(數字)方式給出,也可以以欄位名(字元串)方式給出。行的編號從 0 開始。
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";
}
}
?>
注: 本函式以前的名字為 pg_fieldisnull()。

相關詞條

熱門詞條

聯絡我們