<html>
<head>
<title>МОАТП</title>
</head>
<body>
<?php echo '<p>Коннектимся к базе PostgreSQL:</p>'; ?>
<?php
// Соединение, выбор базы данных
$dbconn = pg_connect("host=pg.sweb.ru port=5432 dbname=moatpru_test user=moatpru_test password=*od***obe**anj*")
or die('Could not connect: ' . pg_last_error());
var_dump($dbconn);
echo '<p>Выполняем SQL запрос:</p>';
$table= "Users";
// generate and execute a query
$query = "SELECT id FROM $table";
$result = pg_query($connection, "SELECT users FROM $table") or die("Error in query: $query.
" . pg_last_error($connection));
// get the number of rows in the resultset
$rows = pg_num_rows($result);
echo "There are currently $rows records in the database.";
// close database connection
pg_close($connection);
?>
<?php echo '<p>FINISH</p>'; ?>
SELECT id FROM Users;
SELECT id FROM "Users";