Storing NOW() mysql to a variable? - 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: Storing NOW() mysql to a variable? (
/showthread.php?tid=662938)
Storing NOW() mysql to a variable? -
JaKe Elite - 16.01.2019
Is it possible to store MySQL's NOW() Date & Time function to a variable?
PHP код:
mysql_format(mysql, query, sizeof(query), "INSERT INTO `accounts` (`NAME`, `REGISTRATION`, `IP`, `PASSWORD`, `SALT`) VALUES ('%e', NOW(), '%s', '%s', '%e')", PlayerInfo[playerid][p_Name], PlayerInfo[playerid][p_newIP], PlayerInfo[playerid][p_Password], PlayerInfo[playerid][p_Salt]);
mysql_tquery(mysql, query, "OnPlayerRegister", "d", playerid);
Re: Storing NOW() mysql to a variable? -
AjaxM - 16.01.2019
Insert it and fetch the result from the DB through cache.
Re: Storing NOW() mysql to a variable? -
JaKe Elite - 16.01.2019
Not quite sure if I did it right, I am quite new in terms of mySQL so please excuse me.
Did I do it right?
PHP код:
mysql_format(mysql, query, sizeof(query), "SELECT `REGISTRATION` FROM `accounts` WHERE `NAME` = '%e' LIMIT 1", PlayerInfo[playerid][p_Name]);
mysql_tquery(mysql, query, "RegistrationCache", "d", playerid);
I have placed it under INSERT INTO and it seems to be working fine, but performance-wise (for the server), is it good?
Re: Storing NOW() mysql to a variable? -
JaKe Elite - 16.01.2019
Just asking but errr... I guess it is okay then?