SA-MP Forums Archive
Age - 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: Age (/showthread.php?tid=476348)



Age - Wizzy951 - 17.11.2013

Found the problem. Thanks for your replies.


Re: Age - HardRock - 17.11.2013

PHP код:
format(querysizeof(query), "UPDATE players SET Age = %d WHERE Name = '%s'"inputtextName(playerid)); 
//Edit: And remove....

PHP код:
mysql_real_escape_string(inputtextEscAge); 



Re: Age - Ardendshy - 17.11.2013

Function strlen(const string[]) get the length of a specific string, but function strval(const string[]) convert a string to an integer. So change strlen(inputtext) to strval(inputtext).


Re: Age - Wizzy951 - 17.11.2013

Quote:
Originally Posted by HardRock
Посмотреть сообщение
PHP код:
format(querysizeof(query), "UPDATE players SET Age = %d WHERE Name = '%s'"inputtextName(playerid)); 
//Edit: And remove....

PHP код:
mysql_real_escape_string(inputtextEscAge); 
I will try it.
EDIT: Oops, I copy-pasted another function, so instead of checking if the entered value is suitable (between 18 and 80) I'm checking the lenght of the entered value and I have to enter 18 characters long value to make it work.