SQL date
#8

PHP код:
    // Get the current date, time
    
getdate(YearMonthDay);
    
gettime(HourMinuteSecond);
    
// Construct the complete date to be added to MySQL for the registration date+time
    
format(Datesizeof(Date), "%04d-%02d-%02d %02d:%02d:%02d"YearMonthDayHourMinuteSecond);

    
// 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_dbQuerysizeof(Query), "INSERT INTO playerdata (Name, Password, RegisterDate, IP) VALUES ('%e', '%s', '%s', '%s')"APlayerData[playerid][Name], APlayerData[playerid][Password], DateAPlayerData[playerid][IP]);
    
mysql_tquery(SQL_dbQuery"Player_OnAccountCreate""i"playerid); 
Some code from my script which uses "date" datatype in sql.
Reply


Messages In This Thread
SQL date - by Squirrel - 10.01.2016, 23:31
Re: SQL date - by itsCody - 10.01.2016, 23:36
Re: SQL date - by Squirrel - 10.01.2016, 23:39
Re: SQL date - by itsCody - 10.01.2016, 23:47
Re: SQL date - by Squirrel - 11.01.2016, 00:05
Re: SQL date - by itsCody - 11.01.2016, 00:06
Re: SQL date - by Squirrel - 11.01.2016, 00:07
Re: SQL date - by AmigaBlizzard - 11.01.2016, 08:14
Re: SQL date - by AmigaBlizzard - 11.01.2016, 08:16
Re: SQL date - by Runn3R - 11.01.2016, 08:17

Forum Jump:


Users browsing this thread: 1 Guest(s)