Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/10/2007, 21:02
helacer
 
Fecha de Ingreso: mayo-2006
Ubicación: Bogotá
Mensajes: 2.061
Antigüedad: 18 años
Puntos: 50
Re: error insert php en mysql

Este es el script
Código PHP:
$creaestab mysql_query("INSERT INTO establecimientos  VALUES ('".$Nit."','".$NombEstab."','".$TipoEstab."','".$Cod_Cliente."','".$Zona."','".$DirEstab."','".$TelfEstab."',1)"); 
este es el script de creacion de la tabla:
Código:
CREATE TABLE `establecimientos` (
  `DNI` int(12) NOT NULL,
  `NOMBRE_ESTAB` varchar(20) NOT NULL,
  `TIPO_ESTAB` int(4) NOT NULL,
  `ID_CLIENTE` int(12) NOT NULL,
  `ZONA` int(4) NOT NULL,
  `DIRECCION` varchar(30) NOT NULL,
  `TELEFONO` varchar(14) NOT NULL,
  `ESTADO` int(2) NOT NULL,
  PRIMARY KEY  (`DNI`),
  FOREIGN KEY (TIPO_ESTAB) REFERENCES tipo_establecimiento (CODIGO),
  FOREIGN KEY (ID_CLIENTE) REFERENCES clientes (CODIGO),
  FOREIGN KEY (ZONA) REFERENCES zonas (CODIGO)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;