Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/02/2008, 14:05
Avatar de destor77
destor77
 
Fecha de Ingreso: noviembre-2004
Ubicación: Gálvez, Santa Fe, Argentina
Mensajes: 2.654
Antigüedad: 19 años, 6 meses
Puntos: 43
error Duplicate entry '0' (1062)

hola:
tengo el siguiente inconveniente, tengo una tabla talents que para ingresar un registro debe tener el mismo id que la tabla pretalent, yo hice un formulario donde paso el id de la tabla pretalent
quiero insertarlo asi:
Código PHP:
INSERT INTO `talents` (`prereg_id` ,`fr_id` ,`agent_fr_id` ,`rating` , `bio` , `feedback` , `w9_date` , `background_check_date` , `background_pass` , `drug_test_date` , `drug_test_pass` , `recruiter_commission` , `registration_status` ) VALUES '$_post[id]''''''''''''''''''''''''' 
la cuestion es que la primera vez me deja pero ya despues y me tira este error:

Duplicate entry '0' for key 2Duplicate entry '0' for key 2I

yo lo unico que quiero es ingresar solamente el id de la tabla preger en talent

la tabla tiene esta estructura:
Código:
CREATE TABLE `talents` (
  `prereg_id` bigint(20) NOT NULL,
  `fr_id` bigint(20) NOT NULL,
  `agent_fr_id` bigint(20) NOT NULL,
  `rating` int(11) NOT NULL,
  `bio` varchar(255) NOT NULL,
  `feedback` varchar(255) NOT NULL,
  `w9_date` date NOT NULL,
  `background_check_date` date NOT NULL,
  `background_pass` tinyint(1) NOT NULL,
  `drug_test_date` date NOT NULL,
  `drug_test_pass` tinyint(1) NOT NULL,
  `recruiter_commission` float NOT NULL,
  `registration_status` int(11) NOT NULL,
  PRIMARY KEY  (`prereg_id`),
  UNIQUE KEY `fr-id` (`fr_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
como puedo hacer para seguir agregado mas datos?

desde ya muchas gracias