MYSQL Select By This Week -
i have user can see uploaded images week.
is correct?
"select * images userid = '$userid' , uploadeddate >= datepart(week, uploadeddate) = datepart(week, getdate()) order uploadeddate desc";
i getting error. help.
select * images userid = $userid , uploadeddate >= curdate() - interval weekday(day) day , uploadeddate < curdate() - interval weekday(day) day + interval 7 day
create index on (userid, uploadeddate)
work fast.
Comments
Post a Comment