From: Ash <ash_whiting@hotmail.com>
To: pgsql-php@postgresql.org
Subject: unsubscribe
Date: Tue, 21 Mar 2006 10:04:36 -0000
Message-ID: <BAY101-DAV8D6F908FE7DC57C3A6D1B88D80@phx.gbl> (raw)
References: <20060321062429.7753.qmail@webmail35.rediffmail.com>
----- Original Message -----
From: manashi chakraborty
To: pgsql-php@postgresql.org
Sent: Tuesday, March 21, 2006 6:24 AM
Subject: [PHP] unable to connect to datadase....
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...
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: ash_whiting@hotmail.com
Subject: Re: unsubscribe
In-Reply-To: <BAY101-DAV8D6F908FE7DC57C3A6D1B88D80@phx.gbl>
References: <20060321062429.7753.qmail@webmail35.rediffmail.com> <BAY101-DAV8D6F908FE7DC57C3A6D1B88D80@phx.gbl>
* 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