Answered PHP Time

PhucedMODZ

Trial Moderator
Staff member
Trial Moderator
Donator
Messages
181
Points
463
right, I’m trying to make it so users can only reset their hwid every 3 months

Here’s how I’ve done it but I’ve never had to mess with php time before (I use timestamp)
 

Attachments

  • Like
Reactions: WW2

WW2

Known Member
Messages
62
Points
133
right, I’m trying to make it so users can only reset their hwid every 3 months

Here’s how I’ve done it but I’ve never had to mess with php time before (I use timestamp)
What is actually the question here? :thinking:
 

PhucedMODZ

Trial Moderator
Staff member
Trial Moderator
Donator
Messages
181
Points
463
What is actually the question here? :thinking:
im asking how the hell do i make it so if the time in the database is less than 3 months then throw them an error that says you need to wait x ammount of time

or if its 3 months or over then let them reset their hwid
 

Matt

Backend Web Developer
Messages
245
Points
603
Surely it would make alot more sense to make an AI field that updates daily that counts to 90? This would allow you to simply run a query to get the datafield for the column of the specified id. Assign this to a variable, then compare this variable to be >=90?

Cuts a hell of alot of corners, but it's the simplest solution that I can see. Here's so pseudo code for this.

Code:
$con = new PDO("mysql:host=$serverinfo;dbname=$databasename", "$username", "password");
$check_time = $con->prepare("SELECT `reset_time` FROM `user_table` WHERE id=":userid"");
$check_time->exectute();
if($check_time >=90){
      //HWID reset functions here;
} else {
     //fail/errormessage here;
}

It's late, Ive been out all day with the Missus and had a few to drink, please let me know if this wasn't what you were asking for.
 
Last edited by a moderator:

Similar threads


Top