php - Why can't I connect to my psql db? -
so trying link page a.php psql db.
here's dbconnection.class.php:
<?php class dbconnection { var $conn function dbconnection(); { $this->conn = pg_connect("host='localhost' port='5432' dbname='tester' user='postgres' password='password'") or die("unable connect"); } } ?>
and here's a.php
<?php include ("dbconnection.class.php"); $dbconnection = new dbconnection(); ?>
it keeps telling me have error on line 7 of dbconnection: fatal error: non-abstract method dbconnection::dbconnection() must contain body in c:\wamp\www\dbconnection.class.php on line 7
i'm not entirely sure far fixing problem
open php.ini find ;extension=php_pgsql.dll , remove initial semi colon find ;extension=php_pdo_pgsql.dll , remove initial semi colon save file restart apache
remove
;
from end of function name
class dbconnection { var $conn function dbconnection() { $this->conn = pg_connect("host='localhost' port='5432' dbname='tester' user='postgres' password='password'") or die("unable connect"); } } ?>
Comments
Post a Comment