php - Extract records for 1 Week Time interval and Them start the next timer when the new week starts -
I'm using the query given below 1 week time interval. To remove the record for
mysql_query ("t1.username", SUM (t2.points), select total actcontest t2 to t1.userid = t2.userid user t1, where Between (CURDATE (t2.date - INTERVAL 1 week) and CURDATE () GROUP TOTAL DESC LIMIT 20 "by t1.username ORDER BY;);
I have been using different queries for this award bonus to top 3 users who have received the record.
This works fine.
Problem: Once the bonus has been awarded last week, the top 3 members will start starting dates from the new week, where the last week ended,
:. We started the timer on the date: [dd / mm / yay]
week 1 = {01-01-2010 to 07/01/2010}
Week 2 = {07-01-2010 to 14/01 / 2010}
Week 3 = {14 -01-2010 to 21/01/2010}
Week 4 = {21-01-2010 to 28/01/2010}
Do you Please help me in making this argument my script is using php and mysql.
What do I want to do?
I have given a bonus to a winner in the week. I want to start bringing the members to the watch next week only, it should not include past dates.
I hope I made the questions clear.
think something about this:
SET @weekNo: = 4; SET @dateStart: '' 2014-01-01 '; SEND ADADDATE (CONCAT (@dateStart, '00: 00: 00 '), INTERVAL 7 * (@ week no- 1) DAY), ADDDATE (CONCAT (@DateStart, '23: 59: 59'), INTERVAL 7 * @ Weekno-one day);
You can see the above scripts in SQL. You can change 2 variables at the top: @wyk no << / code> is the week that you need to calculate the date interval after the start date. And
@at start
is the date that the timer has started.
In your PHP code, you can start date and calculate dates with PHP variables instead of week.
Comments
Post a Comment