Jump to content

Extremely weird INT handling


nysebamse

Recommended Posts

When inserting this integer: 000050007000003 from a form in php this is how it looked after being inserted: 000004294967295.

 

This is the structure of the table:

 

CREATE TABLE `kundekort_prosjekt_relation_kundekort` (

`id` int(11) NOT NULL auto_increment,

`prid` int(11) NOT NULL default \'0\',

`kid` int(15) unsigned zerofill NOT NULL default \'000000000000000\',

PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=10 ;

 

 

I\'ve even tried inserting 000050007000003 manually with phpMyAdmin with the same result as described above.

 

Anyone has any suggestions to why this is occuring? Im pretty close to start chewing on my fist.. :evil:

Link to comment
Share on other sites

Use a Big INT

 

CREATE TABLE `kundekort_prosjekt_relation_kundekort` ( 

`id` int(11) NOT NULL auto_increment, 

`prid` int(11) NOT NULL default \'0\', 

`kid` bigint(15) unsigned zerofill NOT NULL, 

PRIMARY KEY (`id`) 

) TYPE=MyISAM AUTO_INCREMENT=10; 

 

Because INT range is

-2147483648 to 2147483647.

 

Hope this helps

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.