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? Link to comment https://forums.phpfreaks.com/topic/33563-how-to-get-out-put-parameters-value-in-php/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.