From the documentation: https://laravel.com/docs/7.x/database#running-queries
The select method will always return an array of results. Each result within the array will be a PHP stdClass object, allowing you to access the values of the results:
You need something like this to get the result.
DB::select('call generateCugPlanReport(:prefixName, @cugPlanReportID)', [ "prefixName" => $data["prefixName"] ]);
$cugPlanReportID = null;
$selectResult = $DB::select('SELECT @planReportID AS planReportID');
if (!empty($selectResult) && isset($selectResult[0]->planReportID)) {
// we have a result
$cugPlanReportID = $selectResult[0]->planReportID;
}
sheenilim08 liked this reply
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community