Создал файл
<?php
$host = 'localhost';
$db = 'Base';
$user = 'postgres';
$pass = '';
$connection = pg_connect("host=" . $host . " dbname=" . $db ." user=" .$user . " password=" . $pass);
$GLOBALS['link'] = $connection;
?>
В основном файле делаю:
include 'dbConnect.php';
function auth($login){
//$dbconn = pg_connect("host=localhost dbname=Base user=postgres password=");
$result = pg_query($GLOBALS['link'], "Select id from \"Users_auth\" where nick= '" . $login . "'");
pg_close($GLOBALS['link']);
return $result;
}
Выдаёт :
Warning: pg_query(): supplied resource is not a valid PostgreSQL link resource in \localhost\connect.php on line 65
Warning: pg_close(): supplied resource is not a valid PostgreSQL link resource in \localhost\connect.php on line 66
Warning: pg_fetch_result() expects parameter 1 to be resource, boolean given in \localhost\connect.php on line 101