>  기사  >  백엔드 개발  >  zand framwork pdo 预处理 参数绑定长度不同 获取不到值,但库里是有值的,为什么?

zand framwork pdo 预处理 参数绑定长度不同 获取不到值,但库里是有值的,为什么?

WBOY
WBOY원래의
2016-06-06 20:28:341318검색

​sql:select .... where .... district=:district
代码如下:

<code>​$stmt = $this->db->query(
   ​    ​$res['searchstr'],  //sql 语句
   ​    ​$whereis  //绑定参数的数组
​);
</code>

$data = $stmt->fetchAll();

如果 district 为北京有值,为 内蒙古自治区 则没有值,但库中是有值的。

回复内容:

​sql:select .... where .... district=:district
代码如下:

<code>​$stmt = $this->db->query(
   ​    ​$res['searchstr'],  //sql 语句
   ​    ​$whereis  //绑定参数的数组
​);
</code>

$data = $stmt->fetchAll();

如果 district 为北京有值,为 内蒙古自治区 则没有值,但库中是有值的。

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.