Raised This Month: $51 Target: $400
 12% 

how to store float on sql table


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
farawayf
Senior Member
Join Date: Jan 2019
Old 09-06-2019 , 10:30   how to store float on sql table
Reply With Quote #1

PHP Code:
CREATE TABLE IF NOT EXISTS `players` (`steamidVARCHAR(32NOT NULL, `nameVARCHAR(32), `floatVARCHAR(32NOT NULL PRIMARY KEY (`steamid`)) 
Getting like float[client] = results.FetchFloat(0);

i did not find enough information on how to store float on sql table, so i dont know if im doing this right or not.
Is it right to store float like VARCHAR ? if not then how ?
farawayf is offline
Mesharsky How2Kill
AlliedModders Donor
Join Date: May 2017
Location: Poland
Old 09-06-2019 , 20:40   Re: how to store float on sql table
Reply With Quote #2

Why can't you just store float as float?
Why you put it as VARCHAR?

PHP Code:
CREATE TABLE IF NOT EXISTS `players` (`steamidVARCHAR(32NOT NULL, `nameVARCHAR(32), `floatFLOAT(SIZE,dNOT NULL PRIMARY KEY (`steamid`)) 
FLOAT(size, d)
The number of digits after the decimal point is specified in the d parameter

Last edited by Mesharsky How2Kill; 09-06-2019 at 20:41.
Mesharsky How2Kill 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 08:19.


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