#!/usr/local/bin/php session_start(); $db = mysql_connect("www.wide-format-printers.org", "widefomrat","aa") or die("Unable to connect to MySQL"); mysql_select_db("wide-format-printers_org",$db) or die("Could not select wide-format-printers_org"); //Detecta que reportes estan asignados a session $resultcount = mysql_query ("SELECT producto FROM transacciones WHERE idcliente='$PHPSESSID'"); //Cuenta el numero de reportes $resultcount1 = mysql_query ("SELECT count(*) as counter FROM transacciones WHERE idcliente='$PHPSESSID'"); $w=mysql_fetch_array($resultcount1); $count1 = $w[counter]; $count2 = count($_POST); if(isset($_POST)){ foreach ($_POST as $key => $value){ if (isset($PHPSESSID)){ if ($key != "Submit"){ if ($key != "PHPSESSID"){ if ($key != "individual"){ if ($key != "idCombo"){ if ($key != "rep"){ if ($key != "menu"){ mysql_query ("INSERT INTO transacciones (idcliente, producto, precio, idcombo) VALUES ('$PHPSESSID', '$key', $value, '$idCombo')"); } } } } } } } }//foreach }// if getvar $resultcount2 = mysql_query ("SELECT count(*) as counter FROM transacciones WHERE idcliente='$PHPSESSID'"); $m=mysql_fetch_array($resultcount2); $count2 = $m[counter]; ?>