Example #1
0
<?php

include 'config.inc';
$db = pg_connect($conn_str);
$result = pg_exec("SELECT * FROM " . $table_name);
pg_numrows($result);
pg_numfields($result);
pg_fieldname($result, 0);
pg_fieldsize($result, 0);
pg_fieldtype($result, 0);
pg_fieldprtlen($result, 0);
pg_fieldisnull($result, 0);
pg_result($result, 0, 0);
$result = pg_exec("INSERT INTO " . $table_name . " VALUES (7777, 'KKK')");
$oid = pg_getlastoid($result);
pg_freeresult($result);
pg_errormessage();
$result = pg_exec("UPDATE " . $table_name . " SET str = 'QQQ' WHERE str like 'RGD';");
pg_cmdtuples($result);
echo "OK";
Example #2
0
 /**
  * Determine whether the value of a query result located in given row and
  *   field is a NULL.
  *
  * @param resource    $result result identifier
  * @param int    $row    number of the row where the data can be found
  * @param int    $field    field number where the data can be found
  * @return mixed TRUE or FALSE on success, a MDB error on failure
  * @access public
  */
 function resultIsNull($result, $row, $field)
 {
     $result_value = intval($result);
     $this->highest_fetched_row[$result_value] = max($this->highest_fetched_row[$result_value], $row);
     return @pg_fieldisnull($result, $row, $field);
 }