| From: | Chris <dmagick(at)gmail(dot)com> |
|---|---|
| To: | manashi chakraborty <manashi_130582(at)rediffmail(dot)com> |
| Cc: | pgsql-php(at)postgresql(dot)org |
| Subject: | Re: unable to connect to datadase.... |
| Date: | 2006-03-21 06:44:40 |
| Message-ID: | 441FA0D8.7030200@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-php |
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 :-
>
> <?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");
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/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ash | 2006-03-21 10:04:36 | unsubscribe |
| Previous Message | manashi chakraborty | 2006-03-21 06:24:29 | unable to connect to datadase.... |