优化搜索查询 [英] Refining Search Query

查看:83
本文介绍了优化搜索查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我目前正在处理一个房产列表项目,我已经构建了一个搜索查询。

我想知道我的代码是否有效或者如何改进以获得更准确和优化的结果



这是我的查询



Hi,
I am currently working on a property listing project and i have build a Search query.
I wanted to know if my code is efficient or not or how can it be improved to get more accurate and optimized results

Here is my Query

$q = "SELECT * FROM properties WHERE
    (property_type = '$type') AND
    (city = '$city') AND
    (society = '$society') AND
    (purpose = '$purpose') AND
    (area BETWEEN $size_from AND $size_to) AND
    (area_unit = '$unit') AND
    (w_budget BETWEEN $min_price AND $max_price)";

    $r = mysql_query($q);

推荐答案

q = SELECT * FROM properties WHERE
(property_type ='
q = "SELECT * FROM properties WHERE (property_type = '


type')AND
(city ='
type') AND (city = '


city')和
(social ='
city') AND (society = '


这篇关于优化搜索查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆