dantey89
dantey89

Reputation: 2287

Select from table where updated_at not less than 15min

I want to select all records from two tables using Laravel v4 which aren't less than 15min , but i can't. Here is my code:

return Visit::join('users', 'visits.id', '=', 'users.id')->select('ip','users.id','browser','updated_at','name')->where('updated_at','>',time() - (15*60))->get();

Upvotes: 0

Views: 667

Answers (1)

Halcyon
Halcyon

Reputation: 57723

My guess is that updated_at is a DATETIME field, or some derivative.

Compare with:

->where('updated_at','>', date("Y-m-d H:i:s", time() - (15*60)))

Upvotes: 2

Related Questions