困扰了很久的模糊查询问题
比如说搜索SA-PJ1234-#-12H1301,在php用like模糊查询数据库,发现老是查不到。读取搜索字符串时发现,搜索的字符串变成了SA-PJ1234-,为何#之后的内容被截断?
前台输入:<input name="code" type='text' placeholder="请输入编号">
读取数据:$code = trim($_GET["code"]);
查询数据:$sql = "select * from tgs_code where code like '%$code%' limit 1";