search
HomeBackend DevelopmentPHP TutorialZend Framework中的Zend_Db不支持模糊查询?解决思路

Zend Framework中的Zend_Db不支持模糊查询???
Zend Framework中的Zend_Db是不是不支持like查询...
下面为我的主要代码:

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->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;    }}



我用这个代码生成的sql语句在数据库中是对的
可是当我的sql语句中存在like时,就没有得到数据了,可是sql语句在数据库总执行时是有数据的
急急.....
是 不是zend Framework不支持模糊查询还是我的代码写的不对????
那位大侠看哈.....

------解决方案--------------------
恭喜了,jf
------解决方案--------------------
字符集设置的原因。
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
SQL Server使用CROSS APPLY与OUTER APPLY实现连接查询SQL Server使用CROSS APPLY与OUTER APPLY实现连接查询Aug 26, 2022 pm 02:07 PM

本篇文章给大家带来了关于SQL的相关知识,其中主要介绍了SQL Server使用CROSS APPLY与OUTER APPLY实现连接查询的方法,文中通过示例代码介绍的非常详细,下面一起来看一下,希望对大家有帮助。

SQL Server解析/操作Json格式字段数据的方法实例SQL Server解析/操作Json格式字段数据的方法实例Aug 29, 2022 pm 12:00 PM

本篇文章给大家带来了关于SQL server的相关知识,其中主要介绍了SQL SERVER没有自带的解析json函数,需要自建一个函数(表值函数),下面介绍关于SQL Server解析/操作Json格式字段数据的相关资料,希望对大家有帮助。

聊聊优化sql中order By语句的方法聊聊优化sql中order By语句的方法Sep 27, 2022 pm 01:45 PM

如何优化sql中的orderBy语句?下面本篇文章给大家介绍一下优化sql中orderBy语句的方法,具有很好的参考价值,希望对大家有所帮助。

一文搞懂SQL中的开窗函数一文搞懂SQL中的开窗函数Sep 02, 2022 pm 04:55 PM

本篇文章给大家带来了关于SQL server的相关知识,开窗函数也叫分析函数有两类,一类是聚合开窗函数,一类是排序开窗函数,下面这篇文章主要给大家介绍了关于SQL中开窗函数的相关资料,文中通过实例代码介绍的非常详细,需要的朋友可以参考下。

SqlServer创建自动收缩事务日志任务的图文详解SqlServer创建自动收缩事务日志任务的图文详解Sep 09, 2022 pm 01:41 PM

本篇文章给大家带来了关于SQL server的相关知识,SQL Server数据库存在一个问题,如果你限制了它的日志文件的大小,那么当数据库日志达到这个大小的时候,数据库就会停止写入日志,下面这介绍了关于SqlServer创建自动收缩事务日志任务的相关资料,希望对大家有帮助。

linux运行sql文件命令是什么linux运行sql文件命令是什么Mar 02, 2023 am 10:30 AM

linux运行sql文件命令是“psql -f test.sql”,其Linux运行sql脚本的方法是:1、使用shell工具登录到安装postgresql的服务器;2、编辑sql脚本内容;3、通过“psql -f test.sql”命令执行“test.sql”脚本即可。

SQL Server跨服务器操作数据库的图文方法(LinkedServer)SQL Server跨服务器操作数据库的图文方法(LinkedServer)Nov 02, 2022 pm 04:13 PM

本篇文章给大家带来了关于SQL的相关知识,其中主要介绍了SQL Server跨服务器操作数据库的图文方法,SQL Server Management Studio (SSMS) 是用于管理SQL Server 基础结构的集成环境,下面一起来看一下,希望对大家有帮助。

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code<form name="myform"

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment