Home > Backend Development > PHP Tutorial > 这到底是为了啥关于like

这到底是为了啥关于like

WBOY
Release: 2016-06-23 13:39:35
Original
1062 people have browsed it

$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编辑器执行试试。

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template