Re: postgresql csv import pdo
| From: | Ashley Sheridan | Date: | Wed, 15 Sep 2021 07:25:12 +0000 |
| Subject: | Re: postgresql csv import pdo | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-327690@lists.php.net to get a copy of this message | ||
On 14/09/2021 22:50, ourdiaspora wrote:
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? Indeed, what is the error? Is there anything shown in the logs at all? What output do you get?-- Ashley Sheridan https://www.ashleysheridan.co.uk