Getting players time/date registered? [MySQL]
#1

Hello, I was wondering how you would get the players registered time/date. I use MySQL! But I cannot figure a way out on how to get the players time registered? I hope you can help me!

Thanks
Reply
#2

You can use NOW()
Reply
#3

Quote:
Originally Posted by Mr_DjolE
Посмотреть сообщение
You can use NOW()
Whaat? Can you explain more, I don't get you?
Reply
#4

Код:
UPDATE `something` SET `something` = NOW()
That will insert current date/time
Reply
#5

Quote:
Originally Posted by Mr_DjolE
Посмотреть сообщение
Код:
UPDATE `something` SET `something` = NOW()
That will insert current date/time
No, that won't work! Can someone else explain?
Reply
#6

No, that works fine.

Can you post your code ?
Reply
#7

Quote:
Originally Posted by Mr_DjolE
Посмотреть сообщение
No, that works fine.

Can you post your code ?
Which part?
Reply
#8

Err, just show me the insert part.
Reply
#9

Quote:
Originally Posted by Mr_DjolE
Посмотреть сообщение
Err, just show me the insert part.
pawn Код:
stock MySQL_Register(playerid, passwordstring[])
{
    new query[200], pname[24], IP[16];
    GetPlayerName(playerid, pname, 24);
    GetPlayerIp(playerid, IP, 16);
    format(query, sizeof(query), "INSERT INTO playerdata (user, password, Adminlevel, score, money, IP) VALUES('%s', SHA1('%s'), 0, 0, 0, '%s')", pname, passwordstring, IP);
    mysql_query(query);
    SendClientMessage(playerid, INFO, ">> You have sucesfully registered a new account!");
    Logged[playerid] = 1;
    return 1;
}
Reply
#10

Ugh as I can see you don't have any "registered" field.

But anyways that should look like:
pawn Код:
format(query, sizeof(query), "INSERT INTO playerdata (user, password, Adminlevel, score, money, IP, register_date) VALUES('%s', SHA1('%s'), 0, 0, 0, '%s', NOW())", pname, passwordstring, IP);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)