<?
print(pg_fieldprtlen($Result, $Row, 2));
?>
integer pg_fieldsize(integer result, string field)
The pg_fieldsize function returns the size of the field, which may be specified by name
or number. Fields are numbered from zero. See pg_exec for an example of use.
string pg_fieldtype(integer result, string field)
The pg_fieldtype function returns the type of the specified field. The field argument
may be a number or a name. Fields are numbered starting with zero. See pg_exec for an
example of use.
boolean pg_freeresult(integer result)
The pg_freeresult function frees any memory associated with the result set. Ordinarily
it is not necessary to call this function, as all memory will be cleared when the script
ends. See pg_exec for an example of use.
integer pg_getlastoid()
The pg_getlastoid function returns the object ID (OID) of the last object inserted into a
table if the last call to pg_exec was an INSERT statement. Negative one (-1) is returned
if there is an error.
<?
//connect to database
$Connection = pg_connect("", "", "", "", "leon");
$Query = "INSERT INTO item (name, price) ";
$Query .= "VALUES ('hammer', 15.00)";
$Result = pg_exec($Connection, $Query);
print("ID of inserted item: ". pg_getlastoid(). "
\n");
pg_close($Connection);
?>
string pg_host(integer connection)