pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: manashi chakraborty <manashi_130582@rediffmail.com>
To: pgsql-php@postgresql.org
Subject: unable to connect to datadase....
Date: 21 Mar 2006 06:24:29 -0000
Message-ID: <20060321062429.7753.qmail@webmail35.rediffmail.com> (raw)

  
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... 

view thread (2+ messages)  latest in thread

Message-ID: <20060321062429.7753.qmail@webmail35.rediffmail.com>
Permalink:  ../20060321062429.7753.qmail@webmail35.rediffmail.com/
Also on:    postgresql.org/message-id/20060321062429.7753.qmail@webmail35.rediffmail.com

 · 

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: manashi_130582@rediffmail.com
  Subject: Re: unable to connect to datadase....
  In-Reply-To: <20060321062429.7753.qmail@webmail35.rediffmail.com>
  References: <20060321062429.7753.qmail@webmail35.rediffmail.com>

* 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