#Getting all results from db query

10 messages · Page 1 of 1 (latest)

pine stump
#

DB::table('books')->find($id);

vagrant jewel
#

thanks!!!

#

i was searching for this on the docs and couldnt find

pine stump
#

glad i could help

vagrant jewel
#

@pine stump can I choose a specified id field?

#

for exemple vid instead of id ?

pine stump
#

->where('column', 'something')

#

->find() uses the primary key, if you need different fields you can use ->where()

thin valve
#

Just as an FYI, you really should avoid doing this, as this might result in you fetching thousands of records at once which will eventually cause memory issues. Also, why use the DB facade and not Eloquent models?\

dark fog