PDO fetchALL command not returning data

155
January 19, 2020, at 07:40 AM

I am trying to return information from my database, but all I get is an empty array when I know the database table is not empty.

This is my code

$pdo_dbconn = new PDO("pgsql:host=localhost;dbname=null;user=null;password=null")
    or die ("Could not connect");
$sql = $pdo_dbconn->prepare("SELECT * FROM prsnl_codes;");
$sql->execute();
$array = $sql->fetchALL();
var_dump($array);

This is what the response is

array(0) {}

Can anyone tell me what is going on?

Rent Charter Buses Company
READ ALSO
How to Get Both Proxy IP AND real remote IP into Nginx and PHP

How to Get Both Proxy IP AND real remote IP into Nginx and PHP

I am trying to get two IP addresses into the headers so I can read them via PHP the proxy/middleman IP and the real remote client IPIs there a way to get both? I want the real ip in "REMOTE_ADDR" and then the proxy IP in a custom header but it seems if i overwrite...

179
Move all LAMP to Node/Nginx/JS framework? [closed]

Move all LAMP to Node/Nginx/JS framework? [closed]

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post

164
looping through the xml file at the end it throws an error

looping through the xml file at the end it throws an error

How can i loop through this XML stucture

202
Logical issue with extending exceptions in php

Logical issue with extending exceptions in php

With PHP I am using the following class structure for exceptions:

148