Raised This Month: $ Target: $400
 0% 

Float data type table row


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
monolit
Junior Member
Join Date: May 2011
Old 05-14-2011 , 07:04   Float data type table row
Reply With Quote #1

Hey, I've got table row skill (FLOAT)
And I want to insert 10.0 into it, but it doesn't insert, the skill is still 0.

When Player connects I get his skill float like this:
PHP Code:
iSkill[id]        = SQL_ReadResult(Query6) + 0.0
then in-game I receive like 10.0 skill, so when I print it like this:

PHP Code:
client_print(idprint_chat"your skill %0.1f"Float:iSkill[id]) 
it says your skill 10.0

But when I try to save it on client disconnect, like this:

PHP Code:
format(szTemp,charsmax(szTemp),"UPDATE `rank` SET `name` = '%s', `skill` = '%0.1f' WHERE `rank`.`auth` = '%s';",szNameFloat:iSkill[id], szAuthID); 
Then I check it on my phpmyadmin and skill value is still 0.

where is the problem ? as I've mentioned that skill row is skill FLOAT(10)
monolit is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-15-2011 , 02:00   Re: Float data type table row
Reply With Quote #2

That is not how you read a float value from an SQL query.

Code:
new Float:value; SQL_ReadResult(query, column, value);
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode