Jump to content

Recommended Posts

Posted

This is the error:

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "::1", user "postgres", database "inmobiliaria", SSL off in /home/inver/public_html/inmobiliaria/consulta.php on line 12

This is the file that connects to the database. Although locally it works.

<?php

/*Conexion a la base de datos*/

$user = "inver_inverdata";
$password = "*******";
$dbname = "inver_inmobiliaria";
$port = "5432";
$host = "localhost";

$cadenaConexion = "host=$host port=$port dbname=$dbname user=$user password=$password";

$conexion = pg_connect($cadenaConexion) or die("Error en la Conexión: ".pg_last_error());


 
/*$query = "select id, usuario, contrasenia from usuario";

$resultado = pg_query($conexion, $query) or die("Error en la Consulta SQL");
*/



?>

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...