How could I get the records from a certain date? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How could I get the records from a certain date? (
/showthread.php?tid=616362)
How could I get the records from a certain date? -
danielpalade - 03.09.2016
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?
Re: How could I get the records from a certain date? -
SickAttack - 03.09.2016
Adding up to an additional field which saves the hours a player has played in a 7-day cicle.
Re: How could I get the records from a certain date? -
danielpalade - 03.09.2016
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?
Re: How could I get the records from a certain date? -
SickAttack - 04.09.2016
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.
Re: How could I get the records from a certain date? -
danielpalade - 04.09.2016
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?