private static function clearTables(\Core\Database $db)
 {
     $clearScript = new \Helpers\TablesClearScript();
     foreach ($clearScript as $statement) {
         $db->exec($statement, array());
     }
 }
Exemple #2
0
 protected function makeUpdateQuery($table_name, $fields_to_save, array $where_condition, \Core\Database $db)
 {
     $value_equation_list_imploded = $this->makeEquationString(',', $fields_to_save);
     $value_list = $this->makeValueVarArray($fields_to_save);
     $sql = "update {$table_name} set {$value_equation_list_imploded} where " . $this->makeEquationString(' and ', $where_condition);
     $value_list = array_merge($value_list, $this->makeValueVarArray($where_condition));
     //error_log("\nSQL:" . print_r($sql, true) . "\nvalues:" . print_r($value_list, true), 3, "my_errors.txt");
     return $db->exec($sql, $value_list);
 }
 public function deleteById($appId, \Core\Database $db)
 {
     $sql = 'delete from appointments where id=:id';
     $db->exec($sql, array(':id' => $appId));
 }
Exemple #4
0
 public function remove($empId, \Core\Database $db)
 {
     $sql = "delete from employees where id=:id";
     $db->exec($sql, array("id" => $empId));
 }