Saving date in myql
#4

Set the column as timestamp. Then in VALUES part, you call NOW() function or even better set a default value to CURRENT_TIMESTAMP. If you ever want to retrieve when the player registered, execute a query:
pawn Код:
SELECT DATE_FORMAT(RegDate, '%%d/%%m/%%Y %%r') FROM accounts WHERE ...
the registration date is in row index 0 and field index 0 or just set an alias and retrieve it by its column name. You can change the specifiers in DATE_FORMAT if you want to, more here: https://dev.mysql.com/doc/refman/5.5...on_date-format
Reply


Messages In This Thread
Saving date in myql - by ax1 - 10.12.2016, 10:37
Re: Saving date in myql - by Vince - 10.12.2016, 10:42
Re: Saving date in myql - by ax1 - 10.12.2016, 10:47
Re: Saving date in myql - by Konstantinos - 10.12.2016, 10:48
Re: Saving date in myql - by ax1 - 10.12.2016, 11:00
Re: Saving date in myql - by Konstantinos - 10.12.2016, 11:04
Re: Saving date in myql - by Runn3R - 10.12.2016, 11:08
Re: Saving date in myql - by ax1 - 10.12.2016, 13:50

Forum Jump:


Users browsing this thread: 1 Guest(s)