src/Db.php
public function delete($table, $where, $where_tokens = [], $affected_rows = false) {
		// add tokens of where clause
		$values = [];
		if (is_scalar($where_tokens)) $where_tokens = [$where_tokens];
		foreach ($where_tokens as $value) {
			$values[] = $value;
		}
		
		$query = "DELETE FROM `$table` $where";

		$this->connect();
		$sth = $this->prepare($query);
		
		$returner['SUCCESS'] = $sth->execute($values);
		if ($affected_rows) $returner['AFFECTED_ROWS'] = $sth->rowCount();
		return $returner;
	}
public function delete($table, $where, $where_tokens = [], $affected_rows = false) {
		// add tokens of where clause
		$values = [];
		if (is_scalar($where_tokens)) $where_tokens = [$where_tokens];
		foreach ($where_tokens as $value) {
			$values[] = $value;
		}
		
		$query = "DELETE FROM `$table` $where";

		$this->connect();
		$sth = $this->prepare($query);
		
		$returner['SUCCESS'] = $sth->execute($values);
		if ($affected_rows) $returner['AFFECTED_ROWS'] = $sth->rowCount();
		return $returner;
	}
public function delete ( $ table , $ where , $ where_tokens = [ ] , $ affected_rows = false ) { // add tokens of where clause $ values = [ ] ; if ( is_scalar ( $ where_tokens ) ) $ where_tokens = [ $ where_tokens ] ; foreach ( $ where_tokens as $ value ) { $ values [ ] = $ value ; } $ query = "DELETE FROM `$table` $where" ; $ this -> connect ( ) ; $ sth = $ this -> prepare ( $ query ) ; $ returner [ 'SUCCESS' ] = $ sth -> execute ( $ values ) ; if ( $ affected_rows ) $ returner [ 'AFFECTED_ROWS' ] = $ sth -> rowCount ( ) ; return $ returner ; }
Deletes a database row.

@param	string	$table	The table name the query refers to.
@param	string	$where	The where condition in the update query
@param	mixed	$where_tokens	An array (or a scalar) for use as a Prepared Statement in the where clause. Only question marks are allowed for the token in the where clause. You cannot use the colon syntax.
@param	boolean	$affected_rows Set to true to return the count of the affected rows
@return	array	An result array with the keys `SUCCESS` (boolean Was the query successful) and `AFFECTED_ROWS` (int The count of the affected rows)
Deletes a database row .