Raised This Month: $138 Target: $400
 34% 

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
Junior Member
Join Date: May 2017
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


Thread Tools
Display Modes

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 03:14.


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