Home  >  Article  >  Backend Development  >  SQL 问题

SQL 问题

WBOY
WBOYOriginal
2016-06-23 13:33:08953browse

数据库中有值:634680238578
用户输入的值:31971157310000016346802385782010

请问如何查询得到结果。


回复讨论(解决方案)

... where instr('31971157310000016346802385782010',字段)>0

$val='634680238578';
$sql=“select * from tablename where fieldname like '%$val%'”;

不好意思,看错了.....

用 like 也是一样
.... ‘31971157310000016346802385782010’ like concat('%', 字段, '%')

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