Delete rows from the table
@param array $where
@param string $returning
@return mixed
194950
function delete(array $where, $returning = null) {
		$query = $this->getQueryWriter()->reset();
		$query->write("DELETE FROM", $this->conn->quoteName($this->name));
		$query->write("WHERE")->criteria($where);
		if (strlen($returning)) {
			$query->write("RETURNING", $returning);
		}
		return $this->execute($query);
	}
530132
public function delete($table, $where = '', $params = [])
    {
        return $this->getDeleteBuilder()
            ->setTable($table)
            ->setWhere($where, $params)
            ->execute();
    }
1249912
public function delete(string $table, $where=''): ?PDOStatement
	{
		// Set the where clause
		if ( ! empty($where))
		{
			$this->where($where);
		}

		return $this->_run('delete', $table);
	}
767368
public function deleteFrom(string $table, array $where): int
    {
        $delete = new Delete($this->options);
        $sqlParams = $delete->buildQuery($table, $where);
        return $this->query($sqlParams->getSql(), $sqlParams->getParams())->getAffected();
    }
1078183
public function destroy(array $where) {
        $where = $this->_createWhereClause($where, 'AND', false);
        try {
            /**
             * First, see if the user is allowed to update everything
             */
            $this->_checkAcl('destroy');
            $this->_model->delete($where);
        } catch (Garp_Auth_Exception $e) {
            /**
             * If that fails, check if the user is allowed to update her own material
             * AND if the current item is hers.
             */
            $this->_checkAcl('destroy_own');

            /**
             * Good, the user is allowed to 'destroy_own'. In that case we have to check
             * if the current item is actually the user's.
             */
            $rows = $this->_model->fetchAll($where);
            foreach ($rows as $row) {
                if (!$this->_itemBelongsToUser($row->toArray())) {
                    throw new Garp_Auth_Exception(
                        'You are only allowed to delete your own material.'
                    );
                }
                $row->delete();
            }
        }
    }
147208
public function delete($where) {
		$this->provider('cache')->cacheClear('db', $this->getDao()->getTableName());
        $obj = null;
        if (empty($where) == false) {
            foreach ($where as $key => $value) {
                $obj = $this->getConnection()->where($key, $value);
            }
        }
        if ($obj ==  null) return false;
        return $obj->delete($this->getDao()->getTableName());
	}
803900
public function GetDelete($TableName, $Wheres = array()) {
      $Conditions = '';
      $Joins = '';
      $DeleteFrom = '';
      
      if (count($this->_Joins) > 0) {
         $Joins .= "\n";
         $Joins .= implode("\n", $this->_Joins);
         
         
         $DeleteFroms = array();
         foreach ($this->_Froms as $From) {
            $Parts = preg_split('`\s`', trim($From));
            if (count($Parts) > 1)
               $DeleteFroms[] = $Parts[1].'.*';
            else
               $DeleteFroms[] = $Parts[0].'.*';
         }
         $DeleteFrom = implode(', ', $DeleteFroms);
      }

      if (count($Wheres) > 0) {
         $Conditions = "\nwhere ";
         $Conditions .= implode("\n", $Wheres);

         // Close any where groups that were left open.
         $this->_EndQuery();

      }

      return "delete $DeleteFrom from ".$TableName.$Joins.$Conditions;
   }
815942
public function delete($where): Statement
    {
        $this->operation = 'delete';
        if ($where) {
            $this->where = $where;
        }
        return $this;
    }
824429
function deleteWhere($table_name, $where_with_placeholders, $named_parameters) {

            if (empty($where_with_placeholders) || !$table_name) {
                return false;
            }

            $sql_query = 'DELETE FROM ' . $table_name . ' WHERE ' . $where_with_placeholders;

            Event::dispatch(EventData::forBefore(Event::BEFORE_DELETE, $table_name, $named_parameters, $sql_query));
            try {
                //Run Delete query, collect stats
                $stmt = $this->db_connection->prepare($sql_query);
                if (!empty($named_parameters)) {
                    foreach ($named_parameters as $k => $v) {
                        $stmt->bindValue($k, $v);
                    }
                }

                $stmt->execute();
            } catch (Exception $ex) {
                Event::dispatch(EventData::forException($ex, $sql_query, $named_parameters));

                throw new QueryException($ex->getMessage(), $ex->getCode(), $ex);
            }

            $rows_affected = $stmt->rowCount();
            Event::dispatch(EventData::forAfter(Event::AFTER_DELETE, $table_name, $named_parameters, $sql_query, $rows_affected));

            return $rows_affected;

        }
959327
final public function remove($elementName, $return = false) {
        if (isset($this->elements[$elementName])) {
            if ($return)
                $return = $this->elements[$elementName];
            $this->ignoreFilter($elementName);
            unset($this->elements[$elementName]);
            $elementName = str_replace('[]', '', $elementName);
            unset($this->elements[$elementName]);
            unset($this->data[$elementName]);
        }

        return $return ? $return : $this;
    }
565918
public function delete($table, array $where)
    {
        $query = "DELETE FROM `$table` WHERE ";

        $bind = array();
        foreach ($where as $column => $value) {
            $query .= "`$column` = ? AND ";
            $bind[] = $value;
        }

        $query = substr($query, 0, -5);

        // Prepare, bind and execute
        $statement = $this->prepare($query);
        foreach ($bind as $idx => $value) {
            $statement->bindValue(($idx + 1), $value, Database::typeOfValue($value));
        }

        return $statement->execute();
    }
1138828
function delete(string $tableName, $wheres = null)
  {
    if ($wheres === null)
    {
      $this->q("truncate $tableName");
    }
    else if (is_int($wheres) || (is_string($wheres) && ctype_digit($wheres)))
    {
      // 'wheres' is an ID value
      $this->q("delete from $tableName where id=$wheres");
    }
    else
    {
      assert(is_array($wheres));
      $wClause = implode(" and ", $this->makeClauses($wheres));
      $this->q("delete from $tableName where $wClause");
    }

    return $this->affected_rows;
  }
362075
public function delete()
    {
        // Define wheres
        $where = $this->getWhereString();

        // Define where in
        $whereIn = $this->getWhereInString();

        // Build query
        $this->query = 'DELETE FROM ' . $this->table . ' '. $where . ' ' . $whereIn;

        // Prepare statement
        $this->statement = $this->pdo->prepare($this->query);

        // Bind where values
        if (count($this->wheres)) {
            $this->bindWheres();
        }

        // Execute statement
        $result = $this->statement->execute();

        // Reset values
        $this->reset();

        // Return result
        return $result;
    }
856797
public function queryfetch($query, $returnarray=false) {
    list($result, $numrows) = $this->query($query, true);
    
    if($result === false) {
      throw new SqlException($query, $this);
    }

    while($row = $result->fetch(PDO::FETCH_ASSOC)) {
      $rows[] = $row;
    }
    return ($returnarray) ? array($rows, $numrows, result=>$rows, numrows=>$numrows) : $rows;
  }
1253809
public function delete($table, $where, $whereValue)
    {
        $query = $this->provider->buildDeleteQuery($table, $where, $whereValue);

        return $this->provider->query($query, null);
    }
1335135
public function delete($table, $statements, $where)
    {
        $query = 'DELETE FROM `' . $table . '` ';

        $query .= (! is_null($where)) ? ' WHERE ' : '';

        $query .= (is_string($where)) ? $where . ' ' : '';

        if (is_array($where)) {
            foreach ($where as $clause) {
                $query .= $clause . ' AND ';
            }

            $query = rtrim(trim($query), 'AND');
        }

        if (! is_null($statements) && is_array($statements)) {
            return $this->statements($query, $statements);
        }

        return $this->query($query, 'INSERT');
    }
936777
public function delete ($where) 
    {
        parent::delete($where);
        Helper::mapMethod($this->_records, 'delete', array($where));
    }