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
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).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.