我有一个字符串,它存储了我的表'tbl_route‘列’路由_nos‘。
字符串看起来像3,4,7,8,9,10,11,14,16,20
我使用MySQL类操作符从整个字符串中搜索两个数字。
$nosPos="1";
$qr=mysql_query("select * from tbl_route where routes_nos like '% $nosPos %'");但是,当查询执行时,它会返回行。但是这个字符串中没有1。我发现这和11,14,16中的不一样,但我需要精确的搜索。这怎么可能呢?
发布于 2015-06-10 16:30:18
发布于 2017-05-24 09:00:08
对于完全匹配,不要将字符串包含在%.%中,而是直接使用它:
$qr=mysql_query("select * from tbl_route where routes_nos like '$nosPos'"); https://stackoverflow.com/questions/30762014
复制相似问题