I want to insert several values at the same time in a mysq table, I have two INSERT'S but only the first works (formatted), the other is constituted by a for cycle because it is inserted three times but it does not work (orders) this is the code php:
<?php
//conectamos con el servidor
$conectar= mysql_connect('localhost','root','');
//verificamos la conexion
if(!$conectar){
echo"No se pudo conectar con el servidor";
}else{
$base=mysql_select_db('direccion');
if(!$base){
echo"No se encontro la base de datos";
}
}
//recuperar las variables
$area=$_POST['area'];
$numerointerno=$_POST['numerointerno'];
$fecha=$_POST['fecha'];
$folio=$_POST['folio'];
$partida=$_POST['partida'];
$pedidos=$_POST['pedidos'];
$concargo=$_POST['concargo'];
$lote1=$_POST['lote'];
$cantidad=$_POST['cantidad'];
$unidad=$_POST['unidad'];
$conceptos=$_POST['conceptos'];
$costo=$_POST['costo'];
//hacemos la sentencia de sql
$sql="INSERT INTO formatod VALUES('$area','$numerointerno','$fecha','$folio','$partida','$pedidos','$concargo')";
$sql1="INSERT INTO pedidos (lote,cantidad,unidad,conceptos,costo) VALUES";
for ($i = 0; $i < count($lote1); $i++){
$sql1.="('".$lote1[$i]."','".$cantidad[$i]."','".$unidad[$i]."','".$conceptos[$i]."','".$costo[$i]."'),";
echo "<center><strong><h4>¡INSERCIÓN EXITOSA!<br><a href='table.php'></a></strong></h4></center>";
}
?>
I hope you can help me