src/mysql.php
public static function query($sql, $binds=null) {
	if (!empty($binds)) {
		$sql = self::merge($sql, $binds);
	}
	
	// secure against wild update/delete statements
	if (preg_match('{^(UPDATE|DELETE)\s}', $sql) && preg_match('{\s(WHERE|LIMIT)\s}', $sql) == false) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('unsafe UPDATE/DELETE statement, use a WHERE/LIMIT clause');
	}
	
	return self::raw($sql);
}
public static function query($sql, $binds=null) {
	if (!empty($binds)) {
		$sql = self::merge($sql, $binds);
	}
	
	// secure against wild update/delete statements
	if (preg_match('{^(UPDATE|DELETE)\s}', $sql) && preg_match('{\s(WHERE|LIMIT)\s}', $sql) == false) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('unsafe UPDATE/DELETE statement, use a WHERE/LIMIT clause');
	}
	
	return self::raw($sql);
}
public static function query ( $ sql , $ binds = null ) { if ( ! empty ( $ binds ) ) { $ sql = self :: merge ( $ sql , $ binds ) ; } // secure against wild update/delete statements if ( preg_match ( '{^(UPDATE|DELETE)\s}' , $ sql ) && preg_match ( '{\s(WHERE|LIMIT)\s}' , $ sql ) == false ) { $ exception = bootstrap :: get_library ( 'exception' ) ; throw new $ exception ( 'unsafe UPDATE/DELETE statement, use a WHERE/LIMIT clause' ) ; } return self :: raw ( $ sql ) ; }
executes any query on the database

protects against unsafe UPDATE or DELETE statements
blocks when they don't contain a WHERE or LIMIT clause

@param  string $sql   the base sql statement
@param  array  $binds bind values for the given sql, @see ::merge()
@return mysqli_result
executes any query on the database