| From: | "manashi chakraborty" <manashi_130582(at)rediffmail(dot)com> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Unable to connect To Database... |
| Date: | 2006-03-21 06:22:36 |
| Message-ID: | 20060321062236.12420.qmail@webmail45.rediffmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
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 posgres" 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 the code or sum other problem
waiting for the reply...
| From | Date | Subject | |
|---|---|---|---|
| Next Message | PFC | 2006-03-21 08:56:14 | Re: Update counter when row SELECT'd ... ? |
| Previous Message | Daniel CAUNE | 2006-03-21 03:33:22 | Re: Update counter when row SELECT'd ... ? |