naeembhatti Posted January 10, 2007 Share Posted January 10, 2007 hi friends h r u?i use simple stored procedure e.gin mysql=============================CREATE PROCEDURE `test`.`users` (OUT returnval int)BEGINset returnval = 100;END //how to get its value in php===================i am currently using this$mysqli = new mysqli("localhost", "root", "bhatti", "test");if (mysqli_connect_errno()){ printf("Connection failed: %s\n", mysqli_connect_error()); exit();}$SQL = "CALL users(@retval)";if (!$mysqli->real_query($SQL)){ printf("Invalid query: %s\nWhole query: %s\n", $mysqli->error, $SQL); exit();}if ($result = $mysqli->store_result()){ while ($myrow = $result->fetch_array(MYSQLI_ASSOC)) { print_r($myrow); } $result->close();}$mysqli->close();=======================================but when i wrote in phpmyadmin like CALL users(@retval); SELECT @retval; it returns me value but how to get it in php? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.