I use the Zend 2.x framework and run into a problem as I searched a lot. I want to use a similar sentence in the request, but it gives errors every time:
Here are my efforts:
$sql = new Sql($this->adapter);
$select = $sql->select()->columns(
array('user_profile_id', 'profile_login_name'))->from($this->table)->where->like(
'profile_login_name', '%'.$strSearch.'%');
echo $select->getSqlString(); die;
but this gives an error:
Fatal error : calling the undefinedZend \ Db \ Sql \ Where :: getSqlString () method in /var/www/YAAB/branches/admin/models/Model/UserTable.php in online mode 131
I also used Zend \ Db \ Sql \ Predicate, but this also gives an error.
So my question is what
- How to use a similar sentence in a request in zend framework 2?
- What is the problem in my code?
Please reply as soon as possible.
source
share