From: Chris <csmith@squiz.net>
To: P. Jourdan <pippo@videotron.ca>
To: pgsql-php@postgresql.org
Subject: Re: sql command
Date: Fri, 03 May 2002 09:08:37 +1000
Message-ID: <5.1.0.14.0.20020503090035.00aa8630@cooee.cybersydney.com.au> (raw)
In-Reply-To: <5.1.0.14.2.20020502112451.00ac5080@mail.host45.com>
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/
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: csmith@squiz.net, pippo@videotron.ca
Subject: Re: sql command
In-Reply-To: <5.1.0.14.0.20020503090035.00aa8630@cooee.cybersydney.com.au>
References: <5.1.0.14.2.20020502112451.00ac5080@mail.host45.com> <5.1.0.14.0.20020503090035.00aa8630@cooee.cybersydney.com.au>
* 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