Pretty simple but I can't work it out, if I do a count on a table:
$count = DB::table('fixtures')->where('someid', '=', $id)
->count();
How do I view the count value? I've tried the following but no luck:
echo $count[0]->count;
Isnt just :
$count = DB::table('fixtures')->where('someid', '=', $id)->count();
echo $count;
?? :)
The first code is in your controller class? You can do that in the controller class and then return the variable to the view, like this:
$count = DB::table('fixtures')->where('someid', '=', $id)->count();
return View::make('view/path')->with('count', $count);
And in your view call the variable
$count
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community