public function SetTask($multitask, $task) { parent::beginTransaction(); $query = "INSERT INTO task_multitask "; $query .= "(" . implode(",", array_keys($multitask)) . ")"; $query .= " VALUES ('" . implode("', '", array_values($multitask)) . "')"; parent::exec($query); $query1 = "INSERT INTO task_task "; $query1 .= "(" . implode(",", array_keys($task)) . ")"; $query1 .= " VALUES ('" . implode("', '", array_values($task)) . "')"; parent::exec($query1); return parent::commit(); }
public function MysqlInstallTables() { $mysql_table = ""; parent::beginTransaction(); if (count($this->table_key_error) >= 1) { foreach ($this->tables as $key => $value) { $flag = false; for ($i = 0; $i < count($this->table_key_error); $i++) { if ($key == $this->table_key_error[$i]) { $flag = true; break; } } if (!$flag) { $mysql_table = "CREATE TABLE " . $value[TABLE_NAME] . " (" . implode(",", $value[TABLE_VALUE]) . "); "; parent::exec($mysql_table); } } } else { foreach ($this->tables as $key => $value) { $mysql_table .= "CREATE TABLE " . $value[TABLE_NAME] . " (" . implode(",", $value[TABLE_VALUE]) . "); "; } parent::exec($mysql_table); } parent::commit(); }