Re: unable to connect to datadase.... - Mailing list pgsql-php

From Chris
Subject Re: unable to connect to datadase....
Date
Msg-id 441FA0D8.7030200@gmail.com
Whole thread Raw
In response to unable to connect to datadase....  ("manashi chakraborty" <manashi_130582@rediffmail.com>)
List pgsql-php
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/

pgsql-php by date:

Previous
From: "manashi chakraborty"
Date:
Subject: unable to connect to datadase....
Next
From: "Ash"
Date:
Subject: unsubscribe