Re: sql command

Поиск
Список
Период
Сортировка
От Chris
Тема Re: sql command
Дата
Msg-id 5.1.0.14.0.20020503090035.00aa8630@cooee.cybersydney.com.au
обсуждение исходный текст
Ответ на sql command  (PJourdan <info@lespetitsplaisirs.com>)
Список pgsql-php
Hi Phil,

>Could someone explain to me why sql commands work in php with pgsql?

?? Why wouldn't they? :P

>I have a curious situation where the author used sql commands like
>sqlconnect to access the database rather than pg-connect as well as other
>commands that are either psql or sql - I'm a litle confused here. This is
>in a .conf file:
>sqlconnect(array('server'=>'tester.videotron.ca','user'=>'mum',
>     'database'=>'mum','password'=>'123456' ) );
>I'm looking for the theory behind all this. :-)
>Thanks

It looks like the author wrote a function called 'sqlconnect' which takes
an array of data to (obviously) connect to the server.

The function would probably look something like this:

function sqlconnect($connectionarray) {
pg_connect("host=$connectionarray['server'] user=$connectionarray['user']
password=$connectionarray['password'] dbname=$connectionarray['database']");
}

(with more error checking and comments of course).

Do a grep on your code tree for 'function sqlconnect' and look at the file
involved.

It's just a small wrapper function for the full command :)


-----------------
      Chris Smith
http://www.squiz.net/


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

Предыдущее
От: "Rod Taylor"
Дата:
Сообщение: Re: [pgadmin-hackers] sql commands
Следующее
От: Chris
Дата:
Сообщение: Re: boolean error