ya acomode la base de datos y todo fino el problema es este bendito for que me tiene ar.....
Código PHP:
Ver original<?php
if (isset ($_POST['guardar'])){ $idfactura=$_REQUEST['idfactura'];
$idcedula=$_REQUEST['idcedula'];
$fecha=$_REQUEST['fecha'];
$costetotal=$_REQUEST['costetotal'];
$iddetalle_factura=$_REQUEST['iddetalle_factura'];
$idproductos=$_REQUEST['idproductos'];
$cantprod=$_REQUEST['chk_group3'];
$coste=$_REQUEST['chk_group2'];
$personas=$_REQUEST['personas'];
$evento=$_REQUEST['evento'];
$lugar_evento=$_REQUEST['lugar_evento'];
$dia=$_REQUEST['dia'];
$hora_evento=$_REQUEST['hora_evento'];
include("conexion.php");
$sql="SELECT * FROM factura WHERE idfactura='$idfactura'";
if($nrows==0){
for (int i = 0; i < ftotal; i++) {
for(x=0;x<filas;x++){
}
for($j=0;$j<count($cantprod);$j++){ for($k=0;$k<count($coste);$k++){
if (mysql_query("INSERT INTO factura (idfactura,idcedula,fecha,costetotal) VALUES ('$idfactura','$idcedula','$fecha','$costetotal')",$link));
if (mysql_query("INSERT INTO detalles_factura (iddetalle_factura,idfactura,idproductos,cantprod,coste,personas,evento,lugar_evento,dia,hora_evento) VALUES ('$iddetalle_factura','$idfactura','$idproductos','$cantprod[$j]','$coste[$k]','$personas','$evento','$lugar_evento','$dia','$hora_evento')",$link));
}}
echo "<script>alert ('Se ha generado el contrato!');</script>
<META HTTP-EQUIV='REFRESH' CONTENT=0;URL=http:presupuesto.php>";
}
else echo "<script>alert ('Disculpe este presupuesto ya existe!');</script>
<META HTTP-EQUIV='REFRESH' CONTENT=0;URL=http:presupuesto.php>";
}
?>
solo me falta eso disculpa tanta molestia