Home  >  Article  >  Backend Development  >  这终竟是为了啥关于like

这终竟是为了啥关于like

WBOY
WBOYOriginal
2016-06-13 12:15:46911browse

这到底是为了啥关于like
$sqld=$empire->query('SELECT infotags, id FROM hd_ecms_shop_data_1 WHERE hd_ecms_shop_data_1.infotags LIKE "%现货促销产品%"');//查询副表下的infotags字段
 $bqrd=$empire->fetch($sqld);
var_dump($bqrd);
?>
上面这句中在数据库中测试SELECT infotags, id FROM hd_ecms_shop_data_1 WHERE hd_ecms_shop_data_1.infotags LIKE "%现货促销产品%"  查询出三条是正确的
而放在
$sqld=$empire->query('SELECT infotags, id FROM hd_ecms_shop_data_1 WHERE hd_ecms_shop_data_1.infotags LIKE "%现货促销产品%"');//查询副表下的infotags字段
 $bqrd=$empire->fetch($sqld);
var_dump($bqrd);
?>
里面,打印出确是一条,不知为啥,难道是like的事
------解决思路----------------------
把WHERE hd_ecms_shop_data_1.infotags LIKE "%现货促销产品%",拿掉看看印出几笔,还是一样显示一笔代表有重复的变数影响到
------解决思路----------------------
分别die(sql)放在mysql编辑器执行试试。

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