'How do I get a result returned from mysql to php using a stored procedure?

If I am using PHP without a stored procedure I would write something like

$result = mysqli_query($connection, "select * from whatever");

but what happens if the "select * from whatever" is in a stored procedure? how then do I get the $result?
Do I need to write it in such a way that it returns a cursor to php?



Solution 1:[1]

Upon further investigation I found that PHP has a statement class which works with statements in a similar way to using plain sql and it's documentation is here also I found some code to help here but the most important thing I learned in all this is that NO I don't need to create a return variable with a return value to return the data from the query. The query results are automatically available from the prepared statement and because I am just doing the SQL side of things that's all I need to know so far

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 FalconBot