Could anyone help me and see why the script stores the ID into "replacement" row instead of the value from the form. If needed i can post the form script.
ANY help would be appreciated
Here is the process code
<?
include("db.php");
echo "<pre>";
foreach($_POST['fields'] as $items)
{
$qcheck1= mysql_query("select * from fields where id='".$items['hmodel']."'") or die(mysql_error());
$rcheck1=mysql_fetch_array($qcheck1);
$hmodel = $rcheck1['value'];
$qcheck2= mysql_query("select * from fields where id='".$items['case']."'") or die(mysql_error());
$rcheck2=mysql_fetch_array($qcheck2);
$case = $rcheck2['value'];
$qcheck3= mysql_query("select * from fields where id='".$items['error']."'") or die(mysql_error());
$rcheck3=mysql_fetch_array($qcheck3);
$error = $rcheck3['value'];
$q=mysql_query("INSERT INTO `customer_data` (`id`, `name`, `number`, `address`, `case`, `hmodel`, `error`, `other`, `hardwareid`, `replacement`, `hardwarerep`) VALUES (NULL, '".mysql_real_escape_string($_POST['name'])."', '".mysql_real_escape_string($_POST['number'])."', '".mysql_real_escape_string($_POST['address'])."', '".mysql_real_escape_string($case)."', '".mysql_real_escape_string($hmodel)."', '".mysql_real_escape_string($error)."', '".mysql_real_escape_string($items['other'])."', '".mysql_real_escape_string($items['hardwareid'])."', '".mysql_real_escape_string($items['replacement'])."', '".mysql_real_escape_string($items['hardwarerep'])."')") or die(mysql_error());
echo "<br> Din registrering har ID : ".mysql_insert_id();
}
?>