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 119D19DC82D for ; Tue, 21 Mar 2006 02:44:42 -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 83680-05 for ; Tue, 21 Mar 2006 02:44:40 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.206]) by postgresql.org (Postfix) with ESMTP id E0FE29DD54C for ; Tue, 21 Mar 2006 02:44:38 -0400 (AST) Received: by zproxy.gmail.com with SMTP id m7so1699397nzf for ; Mon, 20 Mar 2006 22:44:39 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=t5602ne3whoP+o1i1ss1KJp8DTH+JQJdwro4Dg6ZRa+49pmlweis3genimGjCHsR4LxXhnNlpKX1w+MO/2FDhZU3lnkhoNkGoDTtAzFcotAfjtrDtioft+AcIlEeBX4XiaDdFU9kn19W/Se9AkQixND208q5ON4mlaRQEHrRhx4= Received: by 10.37.14.63 with SMTP id r63mr1732820nzi; Mon, 20 Mar 2006 22:44:39 -0800 (PST) Received: from ?10.1.1.22? ( [203.217.18.65]) by mx.gmail.com with ESMTP id 19sm394946nzp.2006.03.20.22.44.38; Mon, 20 Mar 2006 22:44:39 -0800 (PST) Message-ID: <441FA0D8.7030200@gmail.com> Date: Tue, 21 Mar 2006 17:44:40 +1100 From: Chris User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: manashi chakraborty CC: pgsql-php@postgresql.org Subject: Re: unable to connect to datadase.... References: <20060321062429.7753.qmail@webmail35.rediffmail.com> In-Reply-To: <20060321062429.7753.qmail@webmail35.rediffmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.118 required=5 tests=[AWL=0.118] X-Spam-Score: 0.118 X-Spam-Level: X-Archive-Number: 200603/9 X-Sequence-Number: 3459 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 :- > > 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"); Add this after the pg_connect line: echo pg_last_error(); what does that say? Also change your mail program to send TEXT emails. -- Postgresql & php tutorials http://www.designmagick.com/