0
$currentdate = date("Y-m-d");
$lastweekdate = date("Y-m-d", strtotime("-6 days")); 
$querytopscoreofweek  = 
"SELECT * FROM fb_user WHERE  last_date".
" BETWEEN $lastweekdate AND $currentdate ORDER BY oldscore DESC LIMIT 0,10";

i have field name last_date in this format $currentdate = date("Y-m-d"); i want to execute the above query i want it to return all the users of last week and mean between $lastweekdate and $currentdate and which has also old_score greater in descending order and only 10 users,BUT THE PROBLEM IS THAT IT IS NOT RETURNING ANY THING ANY HINT PLZ

1
  • this looks okay. Is last_date a date field? Are you 100% sure it contains accurate data? Commented Mar 4, 2011 at 21:52

1 Answer 1

1
SELECT * 
FROM fb_user 
WHERE last_date BETWEEN curdate() AND curdate() - interval 6 day 
ORDER BY oldscore DESC LIMIT 10
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.