How to execute stored procedure in php mysql

Hi i want to execute the stored procedure in mysql using php ? can any one give example for this

i have code like this but it show error

Fatal error: Call to undefined function mssql_init() in C:\wamp\www\workouts\storedprocedure.php on line 21



$mysql_host = "localhost";
$mysql_username = "root";
$mysql_password = "";
$mysql_database = "test";

$dbh=mysql_connect($mysql_host,$mysql_username,$mysql_password)or die(mysql_error());//connected to mysql
echo "Connected to SQL";

mysql_select_db($mysql_database,$dbh) or die (mysql_error());//connect to database
echo "connect to db";

$stmt = mysql_init("test2",$conn);

$stmt = $dbh->prepare("CALL test2");
$stmt->bindParam(1, $return_value, PDO::PARAM_STR, 4000);

// call the stored procedure
$stmt->execute();

print "procedure returned $return_value\
";

You cannot use standard mysql to execute statements/stored procedures, you need to use mysqli.

Run through something like this to get a better understanding: http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/

using mysql we couldnt do stored procedures ?

I’m sure I just answered that… ???

Thanks for your reply.

mSsql are you sure, not mYsql ?

lol