Tmysql returns strings only?

Okay so I have a method that uses tmysql.

	tmysql.query("SELECT rank FROM test_accounts WHERE steamid='"..ply:SteamID().."'", function(res, status, error) 
		print(res[1]["rank"])
		if(res[1]["rank"] == "1") then
			 --Sit Tight
			 Msg("Congrats your account exists?")
		else
			 Msg("Account doesn't exist
")
			 test.NewAccount(ply)
		end

when I set the conditional to ask for a 1, as an integer (without the quotes), it always would say account doesn’t exist…

So I tried it with quotes and it worked.

Any ideas why, and how I can fix this, because preferably they don’t come out as strings. Thanks :3

Did you try tonumber( 1 )?

for the


res[1]["rank"]

?

[lua]if(res[1][“rank”] == tonumber( 1 ) ) then[/lua]

Edit:

[lua]if( tonumber( res[1][“rank”] ) == 1 ) then[/lua]

nono, you misunderstood? its the res[1][“rank”] returning as a string (even though the field in the database is a int)…

I tried tonumber on that it appears to be working… if you have any objections that it shouldn’t be tell me so I can make sure I am not screwing anything up.

Oh, I read it wrong, My bad.

np… thanks for the help though ^^. Helped me a LOT actually xD.