Home > Backend Development > PHP Tutorial > php 由表单传过来的值 在数据库里搜寻不到

php 由表单传过来的值 在数据库里搜寻不到

WBOY
Release: 2016-06-13 10:36:22
Original
1020 people have browsed it

php 由表单传过来的值 在数据库里搜索不到
index.php

 

 

 



search.php

$search = "select * from insecticide where( AMW like '%".$_POST['AMW']."%' or MMW like '%".$_POST['MMW']."%' or EH like '%".$_POST['EH']."%' )"; 

可是却搜索不到。是因为语句有语法错误吗?谢谢!


------解决方案--------------------
你把sql放到数据库里面去执行哈看看,
------解决方案--------------------
你确定你数据裤里面的字段是AMW吗。
------解决方案--------------------
把 echo 出来的 语句放入phpmyadmin 或者命令行下执行如何?
------解决方案--------------------
按楼上把echo出来SQL语句复制到phpmyadmin里面执行一下,如果有结果再看看是哪里出问题了吧

Related labels:
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