Posts: 11
Threads: 4
Joined: Jan 2013
Reputation:
0
Hello, im PHP programmer since 3 years now, i'm studying little pawn to create an gamemode, pawn is easy, but i am trying to get a result from mysql, and i get it. The table is an int, and its value ist 3000,, i get the value as string, i need to convert it to int for using the value in the function givePlayerMoney(), i use strval() but it returns me "3" only :S i dont understand why.
Posts: 772
Threads: 52
Joined: Aug 2010
Reputation:
0
Show us how you fetch the value. If the string contains '3000' and you use strval(string) it will return the integer 3000.
Posts: 11
Threads: 4
Joined: Jan 2013
Reputation:
0
The table has the value 3000 an int, i get it as string "3000" and i convert it to int and then it returns me 3 only. I am studying right now and can't show you the code, but later arriving at home i show you.
Posts: 11
Threads: 4
Joined: Jan 2013
Reputation:
0
But suposing this is right, it's an int that i want to save in a var, also int is:
new money;
That shoulde be done, or am i right? cause i think money can hold this for example:
money = 6000;
without problems, but why when i convert the string to an int? i dont know why it would't work.
Posts: 11
Threads: 4
Joined: Jan 2013
Reputation:
0
I think Sinner theory is right, cause i get the SQL string into a string var, this string must be same size or bigger, later i gonna try it Sinner, i think it's that, later i tell you.
Posts: 11
Threads: 4
Joined: Jan 2013
Reputation:
0
Problem solved, thanks all!