Data base error?
#1

I am using a script and i think it uses an inline data base when i want to log in it says type password to register and when i do i stay like that like a freeze almost.
Reply
#2

Can you paste the code here? Probably the DialogResponse handle for registering. Thanks.
Reply
#3

I don't really know where is the coe but think this?
stock OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new
sqlQuery[500],
playername3[MAX_PLAYER_NAME],
password2 = num_hash(password),
playersip[24],
randphone = 100000 + random(899999), //minimum 1000 max 9999 //giving one at the start
registered[24];

new y,m,d,h,mi,s;
getdate(y,m,d); gettime(h,mi,s);
format(registered,sizeof(registered), "%d/%d/%d at %d:%d:%d",d,m,y,h,mi,s);

GetPlayerName(playerid, playername3, sizeof(playername3));
GetPlayerIp(playerid, playersip, sizeof(playersip));

format(sqlQuery, sizeof(sqlQuery), "INSERT INTO samp_users SET `Username`='%s', `Password`='%d', `PhoneNr`='%d', `IP`='%s', `RegistredDate`='%s'", playername3, password2, randphone, playersip, registered);
mysql_query(sqlQuery, THREAD_REGISTER, playerid);
}
return 1;
}
Reply
#4

Yup, it needs a MySQL database server. You need to have one and configure it properly both on your script and your mysql databse.

https://sampforum.blast.hk/showthread.php?tid=129183
Reply
#5

Also, MySQL datetimes looks like this :

PHP код:

2014
-04-11 17:38:22

// Not like that

2014/04/11 17:38:22 
Even if you plan to split the string with "split" (ofc), use a correct DATETIME format (they are here for that I think), instead of a VARCHAR which stands for a DATETIME.
Reply
#6

Does this require me to have a website or something.
Reply
#7

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Also, MySQL datetimes looks like this :

PHP код:

2014
-04-11 17:38:22
// Not like that
2014/04/11 17:38:22 
Even if you plan to split the string with "split" (ofc), use a correct DATETIME format (they are here for that I think), instead of a VARCHAR which stands for a DATETIME.
He wants to save it as string and load it as string without splitting it later on. However using unix timestamp to save it and then load and use from_unixtime in the query to load it with any format you specify.

---

It requires a MySQL server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)