Re: Calling PostgreSQL & MySQL Stored Procedures
| From: | Richard Lynch | Date: | Sun, 23 Oct 2005 01:02:50 +0000 |
| Subject: | Re: Calling PostgreSQL & MySQL Stored Procedures | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-224488@lists.php.net to get a copy of this message | ||
On Sat, October 22, 2005 12:55 pm, Colin Shreffler wrote:
> Can any one please tell me how you call a stored procedure in either
> PostgreSQL or MySQL from php?
WILD GUESS:
$query = "call silly_sproc()";
mysql_query($query, $connection) or die(mysql_error($connection));
pg_exec($connection, $query) or die(pg_last_error($connection));
With an argument is left as an exercise to the reader.
HINT: Stuff whatever you would type in the mysql/psql monitor into $query
No promise this works, as I've only done user-defiend functions rather
than stored procedures (unless those are the same...) in PostgreSQL,
and my webhost's MySQL probably ain't up to stored procedures yet.
--
Like Music?
http://l-i-e.com/artists.htm