Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/10/2009, 11:26
Avatar de huesos52
huesos52
Colaborador
 
Fecha de Ingreso: febrero-2009
Ubicación: Manizales - Colombia
Mensajes: 5.980
Antigüedad: 15 años, 2 meses
Puntos: 360
Respuesta: Insertar datos en 3 tablas

Prueba así:
Código php:
Ver original
  1. $primarykey1 = "INSERT INTO cliente (nombre, foto) VALUES ('$nombrecliente', '$fotito')";
  2. mysql_query($primarykey1);
  3.  
  4. $idcostumer = mysql_insert_id();
  5.  
  6. mysql_query("INSERT INTO telefono (id_cliente, numero) VALUES ('$idcostumer',$numerotelefono')");
  7.  
  8. mysql_query("INSERT INTO localidad(id_cliente, ciudad) VALUES ('$nombreciudad')");

Espera que muevan el tema al foro de php.
__________________
Without data, You are another person with an opinion.
W. Edwads Deming