MYSQL: Save IP problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MYSQL: Save IP problem (
/showthread.php?tid=647807)
MYSQL: Save IP problem -
pulsare - 11.01.2018
I am new & learning mysql. If I want to save IP from a Player, my databse is creating a new player
with the ip 127 (full ip would be 127.0.0.1 (localhost))
Here my Code:
Quote:
new name[MAX_PLAYER_NAME],queryzz[128],IP[35];
GetPlayerName(playerid,name,sizeof(name));
GetPlayerIp(playerid, IP, sizeof(IP));
format(queryzz,sizeof(queryzz),"INSERT INTO user (username,playerip) VALUES ('%s','%s') ",name,IP);
mysql_pquery(dbhandle,queryzz,"","",playerid);
|
Here my MYSQL Databse:
https://www.pic-upload.de/view-34638580/pat.png.html
Re: MYSQL: Save IP problem -
aoky - 11.01.2018
Make sure in your database it is a string and not an INT.
Re: MYSQL: Save IP problem -
pulsare - 11.01.2018
Quote:
Originally Posted by aoky
Make sure in your database it is a string and not an INT.
|
Thx the Ip gets completly saved now but there is another problem.
When Iam going online with my Account Tec9 & when I come again with
for example "tec9" it creates a new user with the name "tec9".
https://www.pic-upload.de/view-34639529/sssd.png.html
Re: MYSQL: Save IP problem -
Beckett - 11.01.2018
Pretty sure that's a lowercase 't' and the other is an uppercase, no? Do you want to prevent that from happening or what's the issue?
PS: You should hash the passwords.
Re: MYSQL: Save IP problem -
pulsare - 12.01.2018
Quote:
Originally Posted by DaniceMcHarley
Pretty sure that's a lowercase 't' and the other is an uppercase, no? Do you want to prevent that from happening or what's the issue?
PS: You should hash the passwords.
|
what ? Didnt understand anything except hashing pw
Re: MYSQL: Save IP problem -
pulsare - 12.01.2018
/////
Re: MYSQL: Save IP problem -
Lucases - 12.01.2018
Toggle off case sensitivity. Maybe it's because of a !strcmp function with third parameter false.
Re: MYSQL: Save IP problem -
pulsare - 12.01.2018
how to do that?
I am learning mysql i dont know
Re: MYSQL: Save IP problem -
pulsare - 13.01.2018
push... Someone has an example?
Re: MYSQL: Save IP problem -
GangstaSunny. - 13.01.2018
INSERT INTO will always create new stuff. Check if the Entry (username) already exist and just SELECT the info. There are tons of good written, newbee-friendly tutorials. I also learned with them.