Millar Posted November 5, 2006 Share Posted November 5, 2006 I have a sum which ends up returning a float because basically it results in larger than 2 billion. I want to insert the value that is larger than 2 billion into a bigint field in a MySQL table, how can I insert it into the field because if you inser the float it simply returns 0 and if I inster it as an integer it just does the maximum of 2147483647? Link to comment https://forums.phpfreaks.com/topic/26217-large-integers/ Share on other sites More sharing options...
ToonMariner Posted November 5, 2006 Share Posted November 5, 2006 ????big int should manage a 20 digit number no probs Link to comment https://forums.phpfreaks.com/topic/26217-large-integers/#findComment-119895 Share on other sites More sharing options...
Millar Posted November 5, 2006 Author Share Posted November 5, 2006 Yes, it does, but PHP can't handle the Number when it is in Integer form, and I need to get it into maybe an equivilent of bigint in PHP to put it into the MySQL database, I can't use a float because that will return zero when you try and insert into database. Link to comment https://forums.phpfreaks.com/topic/26217-large-integers/#findComment-119898 Share on other sites More sharing options...
heckenschutze Posted November 5, 2006 Share Posted November 5, 2006 Well, Possibly insert it as a string... :) Link to comment https://forums.phpfreaks.com/topic/26217-large-integers/#findComment-119908 Share on other sites More sharing options...
Millar Posted November 5, 2006 Author Share Posted November 5, 2006 But that would mean having to change the database field to a string aswell, I can't do that because then I would be able to order it in Ascending and Descending order will I? Link to comment https://forums.phpfreaks.com/topic/26217-large-integers/#findComment-119917 Share on other sites More sharing options...
Skatecrazy1 Posted November 5, 2006 Share Posted November 5, 2006 no, it wouldn't mean having to change the database field as a string....it's simple, just make it a string in PHP, say a variable, then just put the variable into your INSERT INTO query Link to comment https://forums.phpfreaks.com/topic/26217-large-integers/#findComment-119946 Share on other sites More sharing options...
heckenschutze Posted November 5, 2006 Share Posted November 5, 2006 Does't matter, MySQL can still order by string...eg1.6e7is larger than1.7e7So you WILL get expected results. Provided you use this notation for all numbers, regardless of value. Link to comment https://forums.phpfreaks.com/topic/26217-large-integers/#findComment-120075 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.