So, basically what I am doing is a small system that allows students to take online tests and teachers can post an exam and let them know when they have it It was all good while we worked in localhost, but then one of our requests was to use PostgreSQL instead for the database, which seemed cool to us But now we are havving this issue while logging in
Database is already filled with the users and passwords, but it no longer allows us to acces the system no matter if we put a correct password/username set, or actually create a new account
This is the Connection.php file
<
?php
class Connection {
private static $instance;
private $connection;
private function __construct()
{
$cadena = "host='localhost' port='5432' dbname='newdb' user = 'postgres' password = 'system'";
$this->connection = pg_connect($cadena) or die ('Error');
$this->query("SET TIME ZONE -4");
}
public static function getInstance(){
if (!isset(self::$instance))
self::$instance = new Connection();
return self::$instance;
}
public function query($aQuery){
//echo "$aQuery<br>";
return pg_query($this->connection, $aQuery);
}
}
?>
Error always comes up on line 10 ($this->connection = pg_connect($cadena)) Saying that the pg:connect function is undefined, and given we are not experienced with the use of PG, I was hoping you could help us
Sorry if my english fails, as it is not my first language after all