mcmuney Posted May 11, 2010 Share Posted May 11, 2010 What is the significance of this number: 2147483647? I'm collecting telephone number in a form, which is writing the data into a database. I'm see this 2147483647 as a phone number in multiple lines where all other data is different, which appears to be highly odd. Is there any explanation for this? Quote Link to comment https://forums.phpfreaks.com/topic/201434-2147483647/ Share on other sites More sharing options...
Jiblix Posted May 11, 2010 Share Posted May 11, 2010 2,147,483,647 is the highest number possible using 32-bit unsigned integer as a variable type. If you need a number higher than 2,147,483,647 then try a 64-Bit Long data type. These support numbers from negative 9,223,372,036,854,775,808 to positive 9,223,372,036,854,775,807, Zero, and Null. Quote Link to comment https://forums.phpfreaks.com/topic/201434-2147483647/#findComment-1056850 Share on other sites More sharing options...
MatthewJ Posted May 12, 2010 Share Posted May 12, 2010 Or, just ask yourself why you're storing a phone number as an integer Quote Link to comment https://forums.phpfreaks.com/topic/201434-2147483647/#findComment-1056851 Share on other sites More sharing options...
Jiblix Posted May 12, 2010 Share Posted May 12, 2010 Or, just ask yourself why you're storing a phone number as an integer lol ya. I was thinking that myself. Quote Link to comment https://forums.phpfreaks.com/topic/201434-2147483647/#findComment-1056853 Share on other sites More sharing options...
mcmuney Posted May 12, 2010 Author Share Posted May 12, 2010 It's a input field for users to enter their phone number. Under what circumstances, would the number saved be 2147483647 if the user did not input this number? The field has a 10 character limit and does not accept blanks. Yes, the field type happens to be "int(50)". Quote Link to comment https://forums.phpfreaks.com/topic/201434-2147483647/#findComment-1056855 Share on other sites More sharing options...
Jiblix Posted May 12, 2010 Share Posted May 12, 2010 It's a input field for users to enter their phone number. Under what circumstances, would the number saved be 2147483647 if the user did not input this number? The field has a 10 character limit and does not accept blanks. Yes, the field type happens to be "int(50)". Any number HIGHER than "2,147,483,647" will cause the int 2,147,483,647 to be inserted. So.. 2147483648, 6184528348, 9683495836, or anything else will cause 2147483647 to be inserted. Change your data type from int(50) to something like long(15) Quote Link to comment https://forums.phpfreaks.com/topic/201434-2147483647/#findComment-1056857 Share on other sites More sharing options...
mcmuney Posted May 12, 2010 Author Share Posted May 12, 2010 Oh my goodness! Learning something new everyday. Thanks!! Quote Link to comment https://forums.phpfreaks.com/topic/201434-2147483647/#findComment-1056858 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.