Home  >  Article  >  Backend Development  >  PHP gets the value in the input box and compares it with the database to display it.

PHP gets the value in the input box and compares it with the database to display it.

高洛峰
高洛峰Original
2016-12-12 10:31:592784browse

Front-end:



php background receiving and querying:

public function MallList(){ //写方法
$goods=M('shop_goods_info'); //实例化数据库对应的表
$codes=I('param.bianhao'); //获取前台文本框数据
if(isset($codes) && $codes != ''){
$where['code']=$codes;
$this->assign('codes',$codes); //显示
}
}
$info=$classify->where(array('code'=>$code))->find(); //查询语法

2. Or:

has $_GET or $_POST

文本框:

If it is GET, change it to GET


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