Zend_Db in ZendFramework does not support fuzzy query ??? Zend_Db in ZendFramework does not support like queries... the following is my main code: PHPcodeclassDtstockgradeextendsZend_Db_Table_Abstract {Zend_Db in Zend Framework does not support fuzzy queries ???
Does Zend_Db in Zend Framework support like query...
The following is my main code:
PHP code
class Dtstockgrade extends Zend_Db_Table_Abstract { protected $_name = 'dtstockgrade'; protected $_db; public function init(){ $this->_db=$this->getAdapter(); } public function getListSize($classid='',$author='',$stockcode='',$title='',$time=''){ if(strlen($classid)>1){ $where=" classid='".$classid."'"; }else{ $where=" createtime > '".$time."'"; if(strlen($author)>1){ $where.=" and author like '%".$author."%' "; } if(strlen($stockcode)>1){ $where.=" and stockcode='".$stockcode."' "; } if(strlen($title)>1){ $where.=" and title like '%".$title."%' "; } } $sql="select count(*) as total from dtstockgrade where $where"; //file_put_contents("d://a.txt",$sql); $sql=$this->_db->quoteInto($sql,''); $result=$this->_db->query($sql); $result=$result->fetchAll(); return $result; }}
The SQL statement generated using this code is correct in the database.
However, when like exists in my SQL statements, no data is obtained, but the SQL statements have data in the total execution of the database.
Urgent .....
Is it because zend Framework does not support fuzzy search or is my code incorrect ????
Look at the hero .....
------ Solution --------------------
Congratulations! jf
------ Solution --------------------
The reason for setting the character set.