duanke9540 2014-04-02 13:54
浏览 87

如何创建具有多个值的单个框搜索表单

OK, I have a real estate site, and I would like to create a single box search form that would allow the user to enter either city/state, or address, or price, or multiple search options, etc all in this one field and then of course it would return the results......sort of like the zillow or trulia search box. I know how to create a standard form where where there are multiple fields for each type of data, but can anyone point me in the right direction for a single box that a user can input different search terms?

  • 写回答

1条回答 默认 最新

  • dpprx26000 2014-04-02 14:10
    关注

    Your search query has to combine the criteria using OR condition:

    WHERE city=<search_term> or 
    state=<search_term> or 
    price between <search_term>-1000 and <search_term>+1000
    

    and so on. Of course, ranking your query results by relevance is another story.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?