如何创建高级搜索

如何创建高级搜索

本文介绍了如何创建高级搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我有一个任务来创建一个简单的网站,并且想对我的网站进行高级搜索.

基本上,我有一个名为personalinfo的表,该表由姓名,年龄,性别,地址和电话号码组成.

我想做的是创建一个带有五个文本框的高级搜索,分别是:姓名,年龄,性别,地址和电话号码.

因此,基本上,我的高级搜索所要做的就是它允许用户使用许多查询进行搜索.

假设用户要在personalinfo表中查找年龄= 22且性别为女性的人.

因此,他们输入的内容将是用于输入名称的文本框为空白,使用20填充文本框的年龄,使用男性填充文本框的性别,将地址和电话号码文本框保留为空白.

如何编码?

目前,我正在考虑使用很多if,但是我认为效率不高.

任何帮助将不胜感激.

预先谢谢您..

So, I have an assignment to create a simple website and I want to create an advance search to my site.

Basically I have a table called personalinfo that is consist of name, age, gender, address, and phone number.

What I''m trying to do is creating an advance search with five textboxes for input which are; name, age, gender, address, and phone number.

So, basically what my advance search do is it allows user to search by using a number of queries.

Let''s say, user want to find in personalinfo table where age = 22 and gender is female.

So, what their input will be leave the textbox for inputting name blank, textbox age filled with 20, textbox gender filled with male, and leave the address and phone number textbox blank.

How to code it?

Currently I''m thinking of using lots of if, but I think it is not efficient.

Any helps will be really appreciated.

Thank you in advance..

推荐答案



这篇关于如何创建高级搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 04:00