pg_fetch_array Syntax array pg_fetch_array int result , int row [,int result_type] Description The pg_fetch_array function, which is available in PHP 3.0.1 and higher, returns an arr
Trang 1The pg_exec() function, which is available in PHP 3.0 and higher, executes the
query utilizing the given connection and returns an index to the result set or FALSE
on error
pg_fetch_array()
Syntax
array pg_fetch_array (int result , int row [,int result_type])
Description
The pg_fetch_array() function, which is available in PHP 3.0.1 and higher, returns
an array for the fetched row in the result set The optional result_type parameter
can take the following values: PGSQL_ASSOC, PGSQL_NUM, and PGSQL_BOTH The returned array has the data in both indexed and associate formats with the column names as keys
pg_fetch_object()
Syntax
object pg_fetch_object (int result , int row [, int result_type ])
Description
The pg_fetch_object() function, which is available in PHP 3.0.1 and higher, returns
an object containing the data from the fetched row, with the fields accessible by name only The optional result_type parameter can take the values PGSQL_ASSOC, PGSQL_NUM, and PGSQL_BOTH
pg_fetch_row()
Syntax
array pg_fetch_row (int result, int row)
Description
The pg_fetch_row() function, which is available in PHP 3.0.1 and higher, returns a zero-based array containing the data in the result set at the indicated row
Trang 2pg_fieldisnull()
Syntax
int pg_fieldisnull (int result_id, int row, mixed, field)
Description
The pg_fieldisnull() function, which is available in PHP 3.0 and higher, returns TRUE if the field in the row for the referenced result_id is NULL and FALSE
otherwise The field parameter can be the zero-based column number of the
column name
pg_fieldname()
Syntax
string pg_fieldname (int result_id , int field_number)
Description
The pg_fieldname() function, which is available in PHP 3.0 and higher, returns the name of the field at the position field_number in the result set referenced by the
result_id parameter Note that field numbering starts at 0
pg_fieldnum()
Syntax
int pg_fieldnum (int result_id, string field_name)
Description
The pg_fieldnum() function, which is available in PHP 3.0 and higher, returns the number of the given field_name in the result set identified by the result_id
parameter
pg_fieldprtlen()
Syntax
Trang 3int pg_fieldprtlen (int result_id , int row_number, string field_name)
Description
The pg_fieldprtlen() function, which is available in PHP 3.0 and higher, returns the actual printed character length of a field referenced by the field_name parameter at the row_number in the result set referenced by the result_id
parameter
pg_fieldsize()
Syntax
int pg_fieldsize (int result_id, int field_number)
Description
The pg_fieldsize() function, which is available in PHP 3.0 and higher, returns the internal storage size of the field indicated by the field_number parameter in the
result set referenced by the result_id parameter
pg_fieldtype()
Syntax
string pg_fieldtype (int result_id, int field_number)
Description
The pg_fieldtype() function, which is available in PHP 3.0 and higher, returns a string with the type name of the field_number in the given result_id set Note
that field_numbering starts at 0
pg_freeresult()
Syntax
int pg_freeresult (int result_id)
Trang 4Description
The pg_freeresult() function, which is available in PHP 3.0 and higher, frees all resources associated with the result_id result set
pg_getlastoid()
Syntax
int pg_getlastoid (int result_id)
Description
The pg_getlastoid() function, which is available in PHP 3.0 and higher, returns the oid assigned to an inserted tuple if the result identifier is used from the last command sent via pg_exec() and it was an insert statement The return value will
be FALSE if there was an error or if the last command sent via pg_exec() was not an insert statement
pg_host()
Syntax
string pg_host (int connection_id)
Description
The pg_host() function, which is available in PHP 3.0 and higher, returns the name
of the host associated with the given connection_id
pg_loclose()
Syntax
void pg_loclose (int fd)
Description
The pg_loclose() function, which is available in PHP 3.0 and higher, closes the large object referenced by the fd parameter
Trang 5pg_locreate()
Syntax
int pg_locreate (int conn)
Description
The pg_locreate() function, which is available in PHP 3.0 and higher, creates an inversion large object and returns its oid
pg_loopen()
Syntax
int pg_loopen (int conn, int objoid, string mode)
Description
The pg_loopen() function, which is available in PHP 3.0 and higher, opens a large object and returns a file descriptor for it The mode parameter can take the value
'r', 'w', or 'rw' for read, write, or read and write, respectively
pg_loread()
Syntax
string pg_loread (int fd, int len)
Description
The pg_loread() function, which is available in PHP 3.0 and higher, reads the large object referenced by the fd parameter up to len bytes
pg_loreadall()
Syntax
void pg_loreadall (int fd)