469,647 Members | 1,700 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

Returning multiple rows from a stored procedure..

-
I have a country table with code and name columns and create a stored
procedure 'get_countries()' but have no idea what is the syntax to
return multiple rows.

I have searched the newsgroups and understand that the solution is to
use cursors. Searching for the mySQL solution is to no avail.

Do assist me with the syntaxt.
Jul 23 '05 #1
3 7031
- wrote:
I have a country table with code and name columns and create a stored
procedure 'get_countries()' but have no idea what is the syntax to
return multiple rows.

I have searched the newsgroups and understand that the solution is to
use cursors. Searching for the mySQL solution is to no avail.


Did you read the first user comment at the following web page? A user
gives an example of returning a result set from a procedure.
http://dev.mysql.com/doc/mysql/en/st...rocedures.html

Sadly, the online documentation on MySQL's stored procedure language is
pretty lean at this time.

Regards,
Bill K.
Jul 23 '05 #2
-
Bill Karwin wrote:

Did you read the first user comment at the following web page? A user
gives an example of returning a result set from a procedure.
http://dev.mysql.com/doc/mysql/en/st...rocedures.html


Thanks... I tried it on the mysql command prompt and it works but my php
statement produces an error. Is it because I must use a different
method of returning the result - other databases tutorial mentioned
cursors? or is it the function of php itself?

$result = mysql_query("CALL get_countries()");
echo $result; // produces empty result, neither true nor false.
Jul 23 '05 #3
-
- wrote:
$result = mysql_query("CALL get_countries()");
echo $result; // produces empty result, neither true nor false.


That's ok. I solved it using mysqli extension library since stored
proecedure is a new feature in mysql.
Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Stanley Sinclair | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.