Re: Calling PostgreSQL & MySQL Stored Procedures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux