Home  >  Article  >  Backend Development  >  搜索框

搜索框

WBOY
WBOYOriginal
2016-06-23 13:53:071626browse

网上商城都有一个搜索商品框,该功能该如何实现~~~


回复讨论(解决方案)

form表单 action=“xx.php“ method="get"
提交到服务端处理。

是要查询数据库吗,若是该如何查?

搜索框一般是查询数据库的,看你的搜索框是搜什么内容,比如搜商品的标题 或者型号什么的
   


  
 
 
表单提交  search.** 页面 执行查询语句   比如 select * from  TB where title like '%request("ky")%'  or  pronum  like  '%request("ky")%'     
只是打个比方  

要搜索的东西很多就要专门对商品的索引进行处理,如果不是的话那么可以简单的直接搜索型号 编号 名称 .....

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