Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/05/2006, 21:45
fgalicia
 
Fecha de Ingreso: agosto-2002
Mensajes: 121
Antigüedad: 21 años, 8 meses
Puntos: 0
error al insertar autoincrement

que tal, me sale el siguiente error cuanto trato de ejecutar un insert:

1264 Out of range value adjusted for column 'id_plan' at row 1

la sentencia sql es la siguiente:

insert into hosting_planes values ('', 'Personal','100','2048','5','0', '0','1','3','3','images/back_plan.jpg', '1','2006-5-26','22:09:02' )

el primer campo de la tabla es el valor autoincrement, por eso lo dejo como '' solamente, eso me funcionaba en mysql 3.23, ahora tengo php 5.1.4 y mysql 5.0.21

La estructura de la tabla es:

CREATE TABLE `hosting_planes` (
`id_plan` int(11) NOT NULL auto_increment,
`nombre` varchar(20) NOT NULL,
`megas` smallint(6) NOT NULL,
`trafico` smallint(6) NOT NULL,
`correo` smallint(6) NOT NULL,
`correo_listas` smallint(6) NOT NULL,
`db` smallint(6) NOT NULL,
`dominios` smallint(6) NOT NULL,
`subdominios` smallint(6) NOT NULL,
`ftp` smallint(6) NOT NULL,
`image_url` varchar(15) NOT NULL,
`id_root` smallint(6) NOT NULL,
`fecha` date NOT NULL,
`hora` time NOT NULL,
PRIMARY KEY (`id_plan`),
UNIQUE KEY `nombre` (`nombre`),
UNIQUE KEY `image_url` (`image_url`),
KEY `id_root` (`id_root`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- Filtros para la tabla `hosting_planes`
--
ALTER TABLE `hosting_planes`
ADD CONSTRAINT `hosting_planes_ibfk_1` FOREIGN KEY (`id_root`) REFERENCES `root` (`id_root`);

a que se debera el error?

saludos