How could I get the records from a certain date?
#1

Hello,

I have a mysql database where everything is stored.
I have the field named "playingHours" which stores the hours a user has played on the server.
Now how could I grab the hours played in the last 7 days of that user?
Reply
#2

Adding up to an additional field which saves the hours a player has played in a 7-day cicle.
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Adding up to an additional field which saves the hours a player has played in a 7-day cicle.
And I assume I'll have to do the calculation in the script, right? If so, could you give me an example of how I could do it the right way?
Reply
#4

I suggest creating 7 fields in the database, save the time they played each day in each field. Select the fields, adding them up in one SQL statement, to get the time they played in their last 7 days.

Update the 1st field (which would be the last 7th day) to get the time played in their last 7 days everytime.
Reply
#5

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
I suggest creating 7 fields in the database, save the time they played each day in each field. Select the fields, adding them up in one SQL statement, to get the time they played in their last 7 days.

Update the 1st field (which would be the last 7th day) to get the time played in their last 7 days everytime.
But how could I detect if it's monday, or whatever other day?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)