i have a table in mysql to register the event coordinators (for a fest) as:
CREATE TABLE `coordinators` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'coordinator-id',
`eventid` INT UNSIGNED NOT NULL COMMENT 'event-id for which coordinating',
`name` VARCHAR( 100 ) NOT NULL COMMENT 'name of coordinator',
`phone` INT(10) UNSIGNED NOT NULL COMMENT 'event coordinators phone number',
`email` VARCHAR(100) NOT NULL COMMENT 'event coordinator email-id',
INDEX ( `eventid`, `name`, `phone`, `email` )
) ENGINE = INNODB COMMENT = 'stores event coordinator details'
whenever i run a query:
INSERT INTO `coordinators` (eventid, name, phone, email)
VALUES('1', 'abcdef', '8285066537', 'abcdef@xyz.com')
whatever phone number i try, if it is >=9 in length, mysql changes it to 4294967295!!
please help!
Storing phone numbers in numeric fields is never going to work. You’re never going to be able to store the leading zero for example, or other chars like braces or plus symbols which are commonly used to indicate area codes and country codes.
Phone numbers should always be stored as a varchar.