PDA

View Full Version : pg_exec() function still in use?


Socraties
05-13-2003, 08:39 PM
I am not sure this is in the right place if it is please move the thread. I was wondering however if the pg_exec() function used to run a query in postgresql is still used, or if there is another function that the newer versions of php are using. If anyone knows about this it would be great to know.
Thanks.

Jason
05-13-2003, 11:30 PM
what kind of query? http://www.php.net has a function list and pg_exec() isnt there...I have never used that or if I have it hasn't been in ages...


Jason

Socraties
05-14-2003, 12:26 AM
I am trying to run a very simply query like this

$sql = "select firstname from names";
$query = pg_exec($conn,$sql);

I tried looking on php.net for the pg_exec and they don't have it listed, atleast not that I found. Since it is some of the code I am editing I was just wondering if it is still the used, or if I need to update the code that I am putting in some modifications to.

Weirdan
05-14-2003, 10:42 AM
Usually absence of the certain function in function list indicates that the function is obsolete. So you'd better use pg_query (http://www.php.net/manual/en/function.pg-query.php).

<edit>
http://www.php.net/manual/en/function.pg-query.php says:
Note: This function used to be called pg_exec(). pg_exec() is still available for compatibility reasons but users are encouraged to use the newer name. </edit>