Zend_Db in ZendFramework does not support fuzzy query? Solution

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.