pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris <dmagick@gmail.com>
To: manashi chakraborty <manashi_130582@rediffmail.com>
Cc: pgsql-php@postgresql.org
Subject: Re: unable to connect to datadase....
Date: Tue, 21 Mar 2006 17:44:40 +1100
Message-ID: <441FA0D8.7030200@gmail.com> (raw)
In-Reply-To: <20060321062429.7753.qmail@webmail35.rediffmail.com>
References: <20060321062429.7753.qmail@webmail35.rediffmail.com>

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/



view thread (2+ messages)

Message-ID: <441FA0D8.7030200@gmail.com>
Permalink:  ../441FA0D8.7030200@gmail.com/
Also on:    postgresql.org/message-id/441FA0D8.7030200@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: dmagick@gmail.com, manashi_130582@rediffmail.com
  Subject: Re: unable to connect to datadase....
  In-Reply-To: <441FA0D8.7030200@gmail.com>
  References: <20060321062429.7753.qmail@webmail35.rediffmail.com> <441FA0D8.7030200@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox