Esempio n. 1
0
 public function save()
 {
     $q = [];
     $id = Connector::query('SELECT MAX(id) FROM projects');
     $id = $id[0]['MAX(id)'] > 0 ? $id[0]['MAX(id)'] + 1 : 1;
     //echo $id;
     array_push($q, "INSERT INTO projects (id, name, description, insertBy) VALUES(" . $id . ",'" . $this->name . "','" . $this->description . "'," . $this->insertBy . ")");
     array_push($q, "INSERT INTO users_projects VALUES('" . $this->insertBy . "','" . $id . "')");
     $res = Connector::queryTran($q);
     //print_r($res);
 }