As a next step I would try to to dd your variable in your view
@php(dd($results))
Hello, I have browsed many forum including this one and I can't figure out why my variable is undefined when I pass it to my view but when i "dd" my variable it shows my result set properly.
Here is my Controller
$results = [];
do {
try {
$results[] = $stmt->fetchAll(\PDO::FETCH_OBJ);
} catch (\Exception $ex) {
}
} while ($stmt->nextRowset());
// dd($results);
return view('timesheet.show', compact('results'));
And my view doesn't recognize my $result variable because it is "Undefined"
@if(isset($results))
@foreach($results as $result)
{{$result}}
@endforeach
@endif
I have tried passing a random variable with a random value and tried to have it shown with no success. So my guess is probly somewhere else but can`t figure out where.
Any help will be appreciated. Thanks
Please or to participate in this conversation.