Re: How do you call a stored procedure from PHP ...
Here's an example that had been posted to the sproc forum. A 5.0.18 server has a sys db where we keep utility stored procedures, including this simple one ...
CREATE PROCEDURE ShowTables( IN dbname CHAR(64) )
BEGIN
SELECT
table_name,
engine,
version,
table_collation AS collation,
table_rows AS rows
FROM information_schema.tables
WHERE table_schema=dbname;
END;
And here's a simple PHP page which calls it. Change USR & PWD to appropriate values for your setup. If you prefer mysql_connect(), make the 4th param 0 and the 5th param 65536 (see the PHP docs).
<html><body>
<?php
$conn = mysql_pconnect( "localhost", "USR", "PWD", 65536 )
or die( "Failed to connect to MySQL server" );
mysql_select_db( "test", $conn ) or die( "Could not select test database" );
$result = mysql_query( "CALL sys.ShowTables('bench')" )
or die( mysql_error() );
$rows = mysql_num_rows( $result );
echo "Rows=$rows<br/>";
?>
</body></html>