🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.os.linux.programowanie
2 messages
2 total messages Started by Tomasz Z Wed, 22 Sep 1999 11:29
Przylaczanie do bazy danych PostgreSql z poziomu skryptu PHP3
#540
Author: Tomasz Z
Date: Wed, 22 Sep 1999 11:29
43 lines
1985 bytes
Witam

Napisalem skrypt w PHP3 w celu przylaczenia sie do bazy danych PostgreSql

$database = pg_connect("", "", "", "", "PAS_TEST");

pg_exec ($database, "begin");

Otrzymalem komunikat (w przegladarce):

Warning: Unable to connect to PostgresSQL server: FATAL 1: SetUserId: user
'nobody'
is not in 'pg_shadow' in /home/httpd/html/praca.php3 on line 80


lub:

Nastepnie stworzylem usera instrukcja createuser, z parametrami
nazwa usera: test
ID= identyfikator liczbowy usera test
IS allowed to create databases
IS superuser

oraz baze danych test (createdb test)


Po wstawieniu SetUserId=test (probowalem takze identyfikator uzytkownika)

$database = pg_connect("", "", "SetUserId=test", "", "test"); (lub UserID |
ID | User -> bez skutku)

pg_exec ($database, "begin");


Warning: Unable to connect to PostgresSQL server: pqReadData() -- backend
closed the channel unexpectedly. This probably means the backend terminated
abnormally before or while processing the request. in
/home/httpd/html/praca.php3 on line 80

W jaki sposob moge sie polaczyc z baza danych ???

Z gory dzieki za pomoc
-TZ
Re: Przylaczanie do bazy danych PostgreSql z poziomu skryptu PHP3
#541
Author: Przem Kowalczyk
Date: Wed, 22 Sep 1999 23:33
33 lines
1780 bytes
Tomasz Z in pl.comp.os.linux.programowanie wrote:
>Witam
>
>Napisalem skrypt w PHP3 w celu przylaczenia sie do bazy danych PostgreSql

{cut}

>Po wstawieniu SetUserId=test (probowalem takze identyfikator uzytkownika)
>
>$database = pg_connect("", "", "SetUserId=test", "", "test"); (lub UserID |
>ID | User -> bez skutku)

A próbowałeś podać nazwę bazy i hosta?:
pg_connect ($host, $port, "", "", $base_name)

>pg_exec ($database, "begin");
>
>
>Warning: Unable to connect to PostgresSQL server: pqReadData() -- backend
>closed the channel unexpectedly. This probably means the backend terminated
>abnormally before or while processing the request. in
>/home/httpd/html/praca.php3 on line 80
>
>W jaki sposob moge sie polaczyc z baza danych ???

Sprawdzałeś, czy lokalnie chodzi psql?

Przem

-- 
I watched you fall
I think I pushed 
							R.E.M
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads