[SOLVED] how to get results of a store procedure with laravel in the way that all of results can be shown

Issue

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

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

Answered By – ali ahmadi

Answer Checked By – Robin (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *