Re: unable to connect to datadase....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



manashi chakraborty wrote:
hi...
    I am doin my project in PHP with PostgreSQL as backend...
        Both r very new to me....
My OS is LINUX I am trying to connect to the database bt its not getin connected...
  By using
    "su postgres" command
  i hav created user "root" and database "sample"
    By using
    "psql -U root sample" command
      i hav created table "login" and inserted 3 data's...
Now through code using PHP i am trying to insert the data but connection is not getin established.. the code to connect to the datadase is :- <?php
  require_once "DB.php";
  $uname=$_POST['uname'];
  $pass=$_POST['pass'];

$username="root";
$password="";
$hostname="localhost";
$dbname="sample";

$db=new DB;
$dsource=$db->factory("pgsql");

$dcon=pg_connect("dbname=sample user=manashi");


Add this after the pg_connect line:

echo pg_last_error();

what does that say?

Also change your mail program to send TEXT emails.

--
Postgresql & php tutorials
http://www.designmagick.com/


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux