コード例 #1
0
 public function delete($table, $params)
 {
     $cond = array();
     foreach ($params as $field => $value) {
         if (is_int($field)) {
             $cond[] = $value;
         } else {
             $cond[] = "`{$field}` = '{$value}'";
         }
     }
     $cond = implode(' AND ', $cond);
     $query = $this->__renderQuery('delete', array('conditions' => $cond, 'table' => $table));
     $start = getMicroTime();
     mysql_query($query);
     $took = getMicroTime() - $start;
     if (Config::read('debug_mode') == 1) {
         AtmDebug::addRow('DB Queries', array($query, $took));
     }
 }
コード例 #2
0
 public function delete($table, $params)
 {
     $this->queryParams = array();
     $cond = array();
     $data = array();
     foreach ($params as $field => $value) {
         if (is_int($field)) {
             $cond[] = $value;
         } else {
             $cond[] = "`{$field}` = :{$field}";
             $data[":{$field}"] = $value;
         }
     }
     $cond = implode(' AND ', $cond);
     $this->queryParams = $data;
     $query = $this->__renderQuery('delete', array('conditions' => $cond, 'table' => $table));
     $start = getMicroTime();
     $this->runQuery($query);
     $took = getMicroTime($start);
     if (Config::read('debug_mode') == 1) {
         AtmDebug::addRow('DB Queries', array($this->getQueryDump($query), $took));
     }
 }