X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id DAB2A9DCB90 for ; Tue, 21 Mar 2006 02:31:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81659-03 for ; Tue, 21 Mar 2006 02:31:50 -0400 (AST) X-Greylist: delayed 00:06:36.876352 by SQLgrey- Received: from rediffmail.com (unknown [203.199.83.246]) by postgresql.org (Postfix) with SMTP id 87B839DCBB1 for ; Tue, 21 Mar 2006 02:31:47 -0400 (AST) Received: (qmail 7754 invoked by uid 510); 21 Mar 2006 06:24:29 -0000 Date: 21 Mar 2006 06:24:29 -0000 Message-ID: <20060321062429.7753.qmail@webmail35.rediffmail.com> Received: from unknown (203.101.41.32) by rediffmail.com via HTTP; 21 mar 2006 06:24:28 -0000 MIME-Version: 1.0 From: "manashi chakraborty" Reply-To: "manashi chakraborty" To: pgsql-php@postgresql.org Subject: unable to connect to datadase.... Content-type: multipart/alternative; boundary="Next_1142922268---0-203.199.83.246-7692" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=2.177 required=5 tests=[AWL=-0.340, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_WHOIS=0.879, HTML_IMAGE_ONLY_20=0.64, HTML_MESSAGE=0.001, HTML_SHORT_LINK_IMG_3=0.518, MSGID_FROM_MTA_HEADER=0] X-Spam-Score: 2.177 X-Spam-Level: ** X-Archive-Number: 200603/8 X-Sequence-Number: 3458 This is a multipart mime message --Next_1142922268---0-203.199.83.246-7692 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =0Ahi...=0A I am doin my project in PHP with PostgreSQL as backend...= =0A Both r very new to me....=0AMy OS is LINUX =0A I am trying to= connect to the database bt its not getin connected...=0A By using=0A = "su postgres" command=0A i hav created user "root" and database "sample"= =0A By using=0A "psql -U root sample" command=0A i hav created = table "login" and inserted 3 data's...=0A Now through code using PHP i am= trying to insert the data but connection is not getin established.. =0A= the code to connect to the datadase is :-=0A =0Afactory("pgsql");=0A=0A= $dcon=3Dpg_connect("dbname=3Dsample user=3Dmanashi");=0A=0A$sql=3D"insert i= nto login values('$uname','$pass')";=0A=0A$rs=3D$dsource->pg_query($sql);= =0A?>=0A=0A is there anythin wrong with tthe code or sum other problem=0A = waiting for the reply...=20 --Next_1142922268---0-203.199.83.246-7692 Content-type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

=0A 
=0Ahi...
=0A    I am doin my project in PHP w= ith PostgreSQL as backend...
=0A        Both r very= new to me....
=0AMy OS is LINUX 
=0A I am trying to connect t= o the database bt its not getin connected...
=0A  By using
=0A&n= bsp;   "su postgres" command
=0A  i hav created us= er "root" and database "sample"
=0A    By = using
=0A    "psql -U root sample" command
=0A&n= bsp;     i hav created table "login" and inserted 3 dat= a's...
=0A  Now through code using PHP i am trying to insert the d= ata but  connection is not getin established.. 
=0A  t= he code to connect to the datadase is :-
=0A 
=0A<?php
= =0A  require_once "DB.php";
=0A  $uname=3D$_POST['= uname'];
=0A  $pass=3D$_POST['pass'];
=0A
=0A$username=3D&qu= ot;root";
=0A$password=3D"";
=0A$hostname=3D"loca= lhost";
=0A$dbname=3D"sample";
=0A
=0A$db=3Dnew DB;=
=0A$dsource=3D$db->factory("pgsql");
=0A
=0A$dcon=3D= pg_connect("dbname=3Dsample user=3Dmanashi");
=0A
=0A$sql= =3D"insert into login values('$uname','$pass')";
=0A
=0A$rs= =3D$dsource->pg_query($sql);
=0A?>
=0A
=0A  is there an= ythin wrong with tthe code or sum other problem
=0A    waiting= for the reply... =0A

=0A

=0A=0A --Next_1142922268---0-203.199.83.246-7692--