Welcome Guest, Not a member yet? Register   Sign In
Undefined Property with MSSQL and Active Records

Trying to:

$search_query = $this->db->escape_like_str($search_query);
        $this->db->like('news_title', $search_query);
        $this->db->or_like('news_sum', $search_query);
        $data = $this->db->get($this->table_name, $limit, $offset);


Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_DB_mssql_driver::$_like_escape_char
Filename: database/DB_active_rec.php
Line Number: 728

I'm gonna fix this by adding

$this->_like_escape_char = $this->_like_escape_chr;

to my extending DB class. Is this a bug. Or am I doing something wrong?

It is a bug in DB_active_rec.php which is corrected in the newest version under http://bitbucket.org/ellislab/codeigniter

// some platforms require an escape sequence definition for LIKE wildcards
if ($this->_like_escape_str != '')
$like_statement = $like_statement.sprintf($this->_like_escape_str, $this->_like_escape_chr);

($this->_like_escape_char is replaced by $this->_like_escape_chr)

Theme © iAndrew 2016 - Forum software by © MyBB