i wanna to connect to postgresql database using php but it display a blank screen when submit and doesnt execute the query
Thanks in advance
Update: this is my code
function execute_query($dbName,$query){
$host = "localhost";
$user = "postgres";
$pass = "";
$db = "test";
echo "before create connection";
$con = pg_connect ("host=$host dbname=$db user=$user password=$pass");
echo "After connection is created";
if (!$con) {
echo "not connected";
// die('Could not connect: ' . mysql_error());
}
$result = pg_query($con, $query);
pg_close($con);
return $result;
}
The output: display the message "before connection" but doesn't display the message "After connection is created" or "not connected".