Php Programming Code Examples
Php > Other Code Examples
PostgreSQL fetch array
PostgreSQL fetch array
<?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, 0, PGSQL_NUM);
var_dump($arr);
?>