EchoFool Posted September 6, 2008 Share Posted September 6, 2008 I am having a wierd problem with my script... i have a number im inserting to my field (data type bigint(20) ) The number is for example 45.52682 But in the database it just sticks to a full integer and no decimal places. <?php $Gain = 45.52682; $Update = mysql_query("UPDATE users SET Str=Str+'$Gain' WHERE ID='{$_SESSION['UserID']}'") Or die(mysql_error()); ?> What am i doing wrong? Link to comment https://forums.phpfreaks.com/topic/123024-format-of-number-input/ Share on other sites More sharing options...
BlueSkyIS Posted September 6, 2008 Share Posted September 6, 2008 the field type is bigint (big integer). integer. Link to comment https://forums.phpfreaks.com/topic/123024-format-of-number-input/#findComment-635273 Share on other sites More sharing options...
EchoFool Posted September 6, 2008 Author Share Posted September 6, 2008 I'm aware of that but the number will be getting v.large (to the size of bigint which is why i needed it) the number will also include the decimals so what format can i use in the database? Link to comment https://forums.phpfreaks.com/topic/123024-format-of-number-input/#findComment-635282 Share on other sites More sharing options...
BlueSkyIS Posted September 6, 2008 Share Posted September 6, 2008 probably DECIMAL http://dev.mysql.com/doc/refman/5.0/en/precision-math-decimal-changes.html Link to comment https://forums.phpfreaks.com/topic/123024-format-of-number-input/#findComment-635288 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.