Beispiel #1
0
 public function updateTechmap($id, $serial, $descript, $model, $time, $section)
 {
     $instModel = new ModelsList($this->connDB);
     if ($ml_id = $instModel->setId($model)) {
         $ml_id = $instModel->addModel($model);
     }
     $instSection = new SectionsList($this->connDB);
     if ($instSection->setId($section)) {
         $ml_id = $instSection->getId();
     } else {
         $instSection->addModel($section);
         $sl_id = $instSection->lastId;
     }
     $sql = "UPDATE `ns_techmap` SET \n            `serial`='{$serial}',\n            `descript`='{$descript}',\n            `ml_id`='{$ml_id}',\n            `time`='{$time}',\n            `sl_id`='{$sl_id}'\n            WHERE `t_id`='{$id}'";
     //echo "sql=".$sql;
     $res = mysql_query($sql, $this->connDB) or die("Ошибка выполнения: " . $sql . " errors: " . mysql_error());
     if (0 == $res) {
         return false;
     }
     if ($res > 0) {
         return true;
     }
 }