Jump to content

pg_connect() not working for me


afroncio

Recommended Posts

Here is my code:

<?php
  // Connect to the database:
$dbconn = pg_connect("host=xxx.com dbname=xxxx user=postgres password=xxxxxxxx")
    or die('Could not connect: ' . pg_last_error());
?>

 

 

And the result is:

$ php dash_data.php

Fatal error: Call to undefined function: pg_connect() in /Users/afroncio/Sites/dashboard/dash_data.php on line 3

 

Link to comment
https://forums.phpfreaks.com/topic/63590-pg_connect-not-working-for-me/
Share on other sites

PHP needs to be compiled with "--with-pgsql" for pg_connect() (and other PostgreSQL functions) to work. Either your host doesn't support PostgreSQL, or they forgot to compile PHP with PostgreSQL support (in which case they should be willing to recompile PHP to fix this issue).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.