X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A85809DCE3E for ; Tue, 21 Mar 2006 02:30:47 -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 82596-01 for ; Tue, 21 Mar 2006 02:30:46 -0400 (AST) X-Greylist: delayed 00:07:26.592019 by SQLgrey- Received: from rediffmail.com (unknown [203.199.83.135]) by postgresql.org (Postfix) with SMTP id 22D729DD236 for ; Tue, 21 Mar 2006 02:30:43 -0400 (AST) Received: (qmail 12421 invoked by uid 510); 21 Mar 2006 06:22:36 -0000 Date: 21 Mar 2006 06:22:36 -0000 Message-ID: <20060321062236.12420.qmail@webmail45.rediffmail.com> Received: from unknown (203.101.41.32) by rediffmail.com via HTTP; 21 mar 2006 06:22:36 -0000 MIME-Version: 1.0 From: "manashi chakraborty" Reply-To: "manashi chakraborty" To: pgsql-sql@postgresql.org Subject: Unable to connect To Database... Content-type: multipart/alternative; boundary="Next_1142922156---0-203.199.83.135-12405" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.938 required=5 tests=[AWL=-0.579, 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: 1.938 X-Spam-Level: * X-Archive-Number: 200603/322 X-Sequence-Number: 24668 This is a multipart mime message --Next_1142922156---0-203.199.83.135-12405 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 t= o connect to the database bt its not getin connected...=0A By using=0A = "su posgres" 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 t= rying to insert the data but connection is not getin established.. =0A = the code to connect to the datadase is :-=0A =0Afactor= y("pgsql");=0A=0A $dcon=3Dpg_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 anythin wrong with the c= ode or sum other problem=0A waiting for the reply...=20 --Next_1142922156---0-203.199.83.135-12405 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 con= nect to the database bt its not getin connected...
=0A  By using=0A    "su posgres" command
=0A  i hav creat= ed 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 dat= a but  connection is not getin established.. 
=0A  the= code to connect to the datadase is :-
=0A 
=0A<?php
=0A=   require_once "DB.php";
=0A  $uname=3D$_POST['una= me'];
=0A  $pass=3D$_POST['pass'];
=0A
=0A  $username= =3D"root";
=0A  $password=3D"";
=0A  = $hostname=3D"localhost";
=0A  $dbname=3D"sample&quo= t;;
=0A
=0A  $db=3Dnew DB;
=0A  $dsource=3D$db->fac= tory("pgsql");
=0A
=0A  $dcon=3Dpg_connect("dbna= me=3Dsample user=3Dmanashi");
=0A
=0A  $sql=3D"insert= into login values('$uname','$pass')";
=0A
=0A  $rs=3D$dso= urce->pg_query($sql);
=0A ?>
=0A
=0A  is there anythin = wrong with the code or sum other problem
=0A    waiting for th= e reply... =0A

=0A

=0A=0A --Next_1142922156---0-203.199.83.135-12405--