• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved SQL - os.time() / how i use " os.time() " in mysql?[PHP]

Status
Not open for further replies.

milbradt

New Member
Joined
Dec 25, 2011
Messages
177
Solutions
1
Reaction score
4
The lua language using :
Code:
os.time()
How do the same for mysql?


Example in lua:
Code:
getPlayerStorageValue(uid, storage, os.time() + time)


In sql would it?(page php)
Code:
$SQL->query("INSERT INTO `player_storage` (`player_id` ,`key` ,`value`) VALUES ('".$player->getId()."', '999', 'UNIX_TIMESTAMP('time')')");
 
Last edited:
Both UNIX_TIMESTAMP() and time() is the same.

UNIX timestamps are the number of seconds since midnight of January 1, 1970 in UTC.

Post the full script if you need more help.
 
Both UNIX_TIMESTAMP() and time() is the same.

UNIX timestamps are the number of seconds since midnight of January 1, 1970 in UTC.

Post the full script if you need more help.
Thanks!
Solved.

PHP:
Code:
$TEST = time() + 24*60*60;
$SQL->query("INSERT INTO `player_storage` (`player_id` ,`key` ,`value`) VALUES ('".$player->getId()."', '999', '.$TEST.'')");
 
Status
Not open for further replies.
Back
Top