From: Noel Faux <noel.faux@med.monash.edu.au>
To: pgsql-php@postgresql.org
Subject: [Fwd: Re: unable to connect to datadase....]
Date: Wed, 22 Mar 2006 10:38:20 +1100
Message-ID: <44208E6C.5090206@med.monash.edu.au> (raw)
Make sure that the postmaster is running with the -i flag allowing
tcp\ip connections
I suggest you use pg_last_error() and pg_last_notice() to see detailed
errors if any.
Cheers
Noel
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");
>
> $sql="insert into login values('$uname','$pass')";
>
> $rs=$dsource->pg_query($sql);
> ?>
>
> is there anythin wrong with tthe code or sum other problem
> waiting for the reply...
>
>
> <http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signature-home.htm/1507191490@...;
Attachments:noel.faux.vcf (text/x-vcard, 258B) download
begin:vcard
fn:Noel Faux
n:Faux;Noel
org:Monash University;Biochemistry and Molecular Biology
adr:;;;Clayton;Vic;3800;Australia
email;internet:noel.faux@med.monash.edu.au
tel;work:+61 03 9905 1418
url:http://vbc.med.monash.edu.au/~fauxn
version:2.1
end:vcard
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: noel.faux@med.monash.edu.au
Subject: Re: [Fwd: Re: unable to connect to datadase....]
In-Reply-To: <44208E6C.5090206@med.monash.edu.au>
References: <44208E6C.5090206@med.monash.edu.au>
* 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