I have a table that has model details: When I create a new unit I copy this details to the unidetails table:
Code: Select all
$ut = nuRunQuery("SELECT * FROM giga_mod_detail WHERE mdetail_id = '$modelID'");
while($row1 = db_fetch_object($ut)){
$detailnum = $row1->mod_detail_num;
$accessory = $row1->mod_detail_name;
$modtype = $row1->mod_type_id;
$newrecordID = uniqid('1');
$sql = "INSERT INTO giga_udetails (";
$sql .= "giga_udetails_id, udetails_unit_id, udetails_num, udetails_name, udetais_mo_id, udetails_type_id) ";
$sql .= "VALUES ( ";
$sql .= "'$newrecordID','$recordID','$detailnum','$accessory','$modelID','$modtype')";
nuRunQuery($sql);
nuRunQuery("INSERT INTO acc_counter (acc_text) VALUES ('1')");
$t = "UPDATE giga_udetails SET udetails_code = '" . mysql_insert_id() . "' ";
$t .= "WHERE giga_udetails_id = '$newrecordID'";
nuRunQuery($t);
}
Thank You!,
Rui