Jump to content


Photo

Extremely weird INT handling


  • Please log in to reply
2 replies to this topic

#1 nysebamse

nysebamse
  • Members
  • PipPip
  • Member
  • 16 posts
  • LocationBergen, Norway

Posted 29 August 2003 - 10:03 AM

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:
Go get Firefox![br][br]http://www.mozilla.org/

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 29 August 2003 - 10:27 AM

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
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 nysebamse

nysebamse
  • Members
  • PipPip
  • Member
  • 16 posts
  • LocationBergen, Norway

Posted 29 August 2003 - 10:30 AM

Thanks for your help :)

It worked great
Go get Firefox![br][br]http://www.mozilla.org/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users