Support the ongoing development of Laravel.io →
Requests Database Queues
Last updated 2 years ago.
0

Hi mjmgooch.
You're missing a ->get() after the select. When you add it you will probably get a SQL syntax error.
Instead of writing raw sql to the database, I strongly racommend you to use Eloquent. Laravel is a MVC framework. Every model is a class and represents a table in your database (not allways).
With Eloquent you can make queries even when you don't have a model.

DB::table('tblVisit')->select('VisitID')->take(10)->get();
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mjmgooch mjmgooch Joined 20 Oct 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.