Re: unable to connect to datadase....

Поиск
Список
Период
Сортировка
От Chris
Тема Re: unable to connect to datadase....
Дата
Msg-id 441FA0D8.7030200@gmail.com
обсуждение исходный текст
Ответ на unable to connect to datadase....  ("manashi chakraborty" <manashi_130582@rediffmail.com>)
Список 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/

В списке pgsql-php по дате отправления:

Предыдущее
От: "manashi chakraborty"
Дата:
Сообщение: unable to connect to datadase....
Следующее
От: "Ash"
Дата:
Сообщение: unsubscribe