What win32 application? Can you show the table structures and table names?
It is a win32 application from a friend. I develop a small web application which is able to show the data with some nice graphics and stuff. The table is called "bookings" and has some basic columns like 'id', 'productcode' and the 'productname'. A booking is ´basically an action like selling something.
Imagine this structure:
Now I want to retrieve all products ('PRODUCTNAME') and count which off them is selled the most.
I'm not 100% sure, but I believe you need a model. But could you use a combination of grouping and then paginate only 10 for the results.
Some code from the docs:
$users = DB::table('users')
->orderBy('name', 'desc')
->groupBy('count')
->having('count', '>', 100)
->get();
And learn how to use the skip and take in query builder.
$users = DB::table('users')->skip(0)->take(10)->get();
Read over the query builder docs.
Also see if this helps:
http://laravel.io/forum/04-04-2015-looping-through-collection
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community