pg_escape_string
(PHP 4 >= 4.2.0)
pg_escape_string -- Escape string for text/char type
Description
string pg_escape_string ( string data)
pg_escape_string() escapes string for text/char datatype.
It returns escaped string for PostgreSQL. Use of this function
is recommended instead of addslashes().
Note: This function requires PostgreSQL 7.2 or later.
See also pg_escape_bytea()
pg_fetch_all
(PHP 4 >= 4.3.0)
pg_fetch_all -- Fetches all rows from a result as an array
Description
array pg_fetch_all ( resource result)
pg_fetch_all() returns an array that contains all rows (tuples/records)
in result resource. It returns FALSE, if there are no rows.
Example 1. PostgreSQL fetch all
<?php
$conn = pg_pconnect("dbname=publisher");
if (!$conn) {
echo "An error occured.\n";
exit;
}
$result = pg_query($conn, "SELECT * FROM authors");
if (!$result) {
echo "An error occured.\n";
exit;
}
$arr = pg_fetch_all($result);
var_dump($arr);
?>
See also pg_fetch_row(), pg_fetch_array(), pg_fetch_object()
and pg_fetch_result().
|