我开发了一个有18个字段的系统。我希望可以给我的用户提供多重搜索(复选框、单选按钮和文本框)。主要问题是除了在 PHP 中使用 if
和 elseif
语句之外,如何在 MySQL 中执行搜索功能。
I have 6 checkbox :
[]US
[]Canada
[]Japan
[]Seoul
[]Taiwan
[]Australia
radio button for backup service:
[]yes
[]no
radio button for security service:
[]yes
[]no
radio button for recovery service:
[]yes
[]no
textbox for basic price
[ ]
textbox for 1 year price
[ ]
只需在表单中使用搜索按钮,并在其单击事件中使用帖子页面或同一页面上将值传输到相应的 PHP 页面,然后在 if else 语句中使用以下方式使用您要从数据库中搜索的值触发 SQL 查询:
select * from table where country = '".$_GET["country"]."';