Jump to content

Monthly Top 45 script


koughman

Recommended Posts

in this query[code]SELECT * FROM yourTable WHERE DATE_SUB(yourDate, INTERVAL 1 MONTH)<=NOW() ORDER BY score DESC LIMIT 45[/code] what do you mean by yourdate? like the date of the entry, in that case im using php date function and wouldnt that screw it up?
Link to comment
Share on other sites

You should check the syntax of the STR_TO_DATE() function -- you need to pass in your PHP date string, and then define how it is composed: for example, STR_TO_DATE('04/31/2004', '%m/%d/%Y'). Simply substitute your PHP date for the date string and you're done.
Link to comment
Share on other sites

[!--quoteo(post=343993:date=Feb 8 2006, 11:32 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Feb 8 2006, 11:32 PM) [snapback]343993[/snapback][/div][div class=\'quotemain\'][!--quotec--]
You should check the syntax of the STR_TO_DATE() function -- you need to pass in your PHP date string, and then define how it is composed: for example, STR_TO_DATE('04/31/2004', '%m/%d/%Y'). Simply substitute your PHP date for the date string and you're done.
[/quote]
my date is like January 5th 2005 and im a n00b with php/mysql can one of you plz help with the exact script, thanks
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.