'how to get results of a store procedure with laravel in the way that all of results can be shown
I have a store procedure in mysql and when I run it with phpmyadmin tools, results are like this my myql procedure result
that all of semi-tables (I mean result sets) are correct. but with laravel code including this
$dataSet = DB::select('CALL MY_PROC(?,?);', array($param1, $param2));
return \Response::json([
'dt1' => $dataSet,
], 200);
I get this result
{"dt1":[
{"operation4":7185,"operation5":18167}
]}
that means it gives me just one of result sets. how can I get all of result set with laravel?
Solution 1:[1]
based on @ADyson help, I find out "Laravel's DB facade does not support calling stored procedures that returns multiple data sets in result out of the box" and this github repository is working for me https://github.com/rodion-arr/laravel-mysql-stored-procedures
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 | ali ahmadi |
