
17/10/2009, 12:41
|
 | | | Fecha de Ingreso: abril-2004 Ubicación: Merlo, buenos aires
Mensajes: 364
Antigüedad: 21 años Puntos: 1 | |
Respuesta: Insertar datos en 3 tablas Me tira este error:
<?
$host = "localhost";
$user = "usuario_db";
$pass = "clave";
$db = "nombre_db";
$connect = mysql_connect($host,$user,$pass);
$database = mysql_select_db($db, $connect);
//CLIENTE
$nombrecliente = $_GET[nombrecliente];
$imgcliente = $_GET['imgcliente'];
//TELEFONO
$tipotelefono = $_GET[tipotelefono];
$codigoarea = $_GET[nombrecliente];
$numerotelefono = $_GET[numerotelefono];
// 22 VENTA
$cantidadventa = $_GET[cantidadventa];
//UPLOAD FOTO
$nombre=$_FILES['imgcliente']['name'];
$id = md5(uniqid(rand(), true));
$ext= substr(strrchr($nombre, "."),1);
$nvo= $id.".".$ext;
$foto= "imagenes/".$nvo;
move_uploaded_file($_FILES['imgcliente']['tmp_name'], $foto);
$insertSQL1 = "INSERT INTO cliente (nombre, foto) VALUES ('$nombrecliente', '$nvo')";
mysql_query($insertSQL1);
$idcostumer = mysql_insert_id();
$insertSQL2 = "INSERT INTO telefono (id_cliente, tipo_telefono, codigo_area, numero) VALUES ('$idcostumer','$tipotelefono',
'$codigoarea', $numerotelefono')";
$insertSQL3 = "INSERT INTO venta (cantidad) VALUES ('$idcostumer', '$cantidadventa')";
mysql_select_db($db, $connect);
$Result1 = mysql_query($insertSQL1, $connect) or die(mysql_error());
$Result2 = mysql_query($insertSQL2, $connect) or die(mysql_error());
$Result3 = mysql_query($insertSQL3, $connect) or die(mysql_error());
?>
BUENO ÉSTE ES EL CÓDIGO COMPLETO PHP CON MIS CAMPOS DE TABLAS ORIGINALES SIGUE SIN FUNCIONAR SOLO ME CARGA LOS CAMPOS DE LA TABLA CLIENTE LA 1ERA. Y ESTE ES EL ERROR QUE ACTUALMENTE ME TIRA:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '')' at line 1
__________________ "Life goes on..." |