11.01.2016, 08:14
PHP код:
// Get the current date, time
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
// Construct the complete date to be added to MySQL for the registration date+time
format(Date, sizeof(Date), "%04d-%02d-%02d %02d:%02d:%02d", Year, Month, Day, Hour, Minute, Second);
// Add the player's account to the MySQL database (escape the name only, as there is no need to escape a hashed password)
mysql_format(SQL_db, Query, sizeof(Query), "INSERT INTO playerdata (Name, Password, RegisterDate, IP) VALUES ('%e', '%s', '%s', '%s')", APlayerData[playerid][Name], APlayerData[playerid][Password], Date, APlayerData[playerid][IP]);
mysql_tquery(SQL_db, Query, "Player_OnAccountCreate", "i", playerid);