I'm trying to make a Login system in PHP using PostgreSQL however, I can not get my application to connect to the Database. follow the code:
<?php
$connect = pg_connect("dbname=testebd"); //Banco de dados previamente criado
if (!$connect)
{
echo "Conexão não realizada";
} else
{
echo "Conexão bem sucedida";
}
?>
When I run my application, absolutely nothing happens. The page is completely blank. I can not even print the contents of the variable:
$connect = pg_connect("dbname=testebd");
echo "$connect";
Someone knows tell me why the connection is not being performed ?. Note: I use the Apache server in an Ubuntu and I can usually use postegreSQl by bash.