CI_DB_mysqli_driver::_prep_query PHP Method

_prep_query() protected method

If needed, each database adapter can prep the query string
protected _prep_query ( string $sql ) : string
$sql string an SQL query
return string
    protected function _prep_query($sql)
    {
        // mysqli_affected_rows() returns 0 for "DELETE FROM TABLE" queries. This hack
        // modifies the query so that it a proper number of affected rows is returned.
        if ($this->delete_hack === TRUE && preg_match('/^\\s*DELETE\\s+FROM\\s+(\\S+)\\s*$/i', $sql)) {
            return trim($sql) . ' WHERE 1=1';
        }
        return $sql;
    }