Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

Querying Vertica using PHP PDO PostgreSQL, is it possible?


I'm on FreeBSD with PHP. As I mentioned in this topic - I was unable to find solution to use Vertica ODBC driver with FreeBSD. So, now I'm looking for another ways to query Vertica from PHP.

In this stackoverflow topic @deadrunk told that it is possible to use Postgres client libs to connect Vertica.

I've tried using pgsql for PDO. Connection is ok, but querying seems to be faild with no errors. Do anybody know any information about how to do it properly? Here is the piece of code I was using:
$PDO = new \PDO('pgsql:dbname=mydb;host=myhost;port=5433', 'dbadmin', 'test');  $sth = $PDO->prepare('SELECT table_name FROM tables');  $sth->execute();  $result = $sth->fetch(\PDO::FETCH_ASSOC);  print_r($result);
Result contains nothing.
PS: I'm very sorry, I'm pretty new to Vertica.

Thank you!


Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.