postgresql csv import pdo
[email protected] (ourdiaspora)
| Newsgroups | php.general |
|---|---|
| Message-ID | <slV_VvGR9xfMYobNLhEV93XZeLDShquRxvcSPtZwFsBo--yZFoOEb0TTNKVbdS9rWmtGcWVL1ZWziM4QgZU6_1BBQEXL44lxDTC0F0kdSS8=@protonmail.com> |
Readers,
Forgive the simplicity, but having problems to start:
<?php
try {
$dbconnect = new PDO(pgsql:host=localhost; dbname=cpacweb; user=someuser; password=somepassword);
}
catch(PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
$query = "SELECT * FROM somedata";
$result = pg_exec($dbconnect, $query);
echo "Number of rows: " . pg_numrows($result);
pg_freeresult($result);
pg_close($dbconnect);
?>
No error message, no print of rows of table. Please what is the error?