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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -