Hi,
This is my first script to connect to psql db and it is failing. My code :
<?
// database access parameters
// open a connection to the database server
$connection = pg_connect ("host=00.0.000.00 port=5432 dbname=consult user=consult password=Phun@ccr,");
if (!$connection)
{
die("Could not open connection to database server");
}
// generate and execute a query
$query = "SELECT * FROM msu9900";
$result = pg_query($connection, $query) or die("Error in query: $query.
" . pg_last_error($connection));
// get the number of rows in the resultset
$rows = pg_num_rows($result);
echo "There are currently $rows records in the database.";
// close database connection
pg_close($connection);
?>
Error I am getting is:
Fatal error: Call to undefined function: pg_query() in /usr/local/tomcat/webapps/ussa/testpage.php on line 19
Any thoughts?
Thanks
Sri