Hi guys,
Hope you can help me with this simple query. I have this function.
public function CapTracker()
{
$get_tracker_data = DB::select("select neighbourhood, agent_first_name, agent_last_name, cap_tracking.add_date from cap_tracking, neighbourhoods, client_assurance_members where cap_tracking.neighbourhood_id = neighbourhoods.neighbourhood_id and cap_tracking.agent_id = client_assurance_members.id");
return view('admin.cart.cap-tracker-list')->with('get_tracker_data', $get_tracker_data);
}
What is wrong with this?? If I copy that query and run it directly on the server I get the 5 results as expected..... very confused here.
Thanks.
Hi there!
On my view I have this:
@foreach($get_tracker_data as $get_tracker_data)
<tr>
<td><?php echo $get_tracker_data->neighbourhood;?></td>
<td><?php echo $get_tracker_data->agent_first_name.' '.$get_tracker_data->agent_last_name;?></td>
<td><?php echo $get_tracker_data->add_date;?></td>
</tr>
@endforeach
And I'm getting the error: "Trying to get property of non-object" on the first line in php where I echo.
I did this EXACT same process on another function and view and it worked fine. Thanks.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community