|
Home
iRate! IceMelon IM Tutorials Headlines CoolSites PHP Functions |
|
Most Referenced Functions » google_pagerank() » preg_replace() » imagecreatefrompng() » site_pageranks() » imagepng() » imagedestroy() » imagestring() » imagecolorallocate() » htmlentities() » preg_match() » fopen() » header() » getimagesize() » preg_match_all() » session_start() » htmlspecialchars() » ob_start() » ob_flush() » strstr() » flush() » strpos() » setcookie() » str_replace() » array2vars() » nl2br() » preg_split() » ereg() » ereg_replace() » urlencode() » readgzfile() Become a sponsor for $15/month. Link is sitewide - PR5 homepage, 20+ PR4 pages, 90+ PR3 pages. Email dave[AT]icemelon[D0T]c0m. |
PHP Functions
Function: pg_field_is_null (PHP 4 >= 4.2.0, PHP 5) pg_field_is_null -- Test if a field is SQL NULLDescriptionint pg_field_is_null ( resource result, int row, mixed field ) int pg_field_is_null ( resource result, mixed field )pg_field_is_null() tests if a field in a PostgreSQL result resource is SQL NULL or not. Note: This function used to be called pg_fieldisnull() . Parameters
result PostgreSQL query result resource, returned by pg_query() , pg_query_params() or pg_execute() (among others). rowRow number in result to fetch. Rows are numbered from 0 upwards. If omitted, current row is fetched. fieldField number (starting from 0) as an integer or the field name as a string . Return ValuesReturns 1 if the field in the given row is SQL NULL , 0 if not. FALSE is returned if the row is out of range, or upon any other error. Examples
Example 1. pg_field_is_null() example
<?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";
}
}
?>
Related Function(s) |