查询以类似于婚姻搜索的方式进行搜索. [英] Query to search like Matrimonial search.
本文介绍了查询以类似于婚姻搜索的方式进行搜索.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友,
我想要一个包含多个列的搜索值查询,就像任何婚姻网站一样.
我正在使用以下查询:
hi friends,
I want a query for search value taking multiple columns like any matrimonial site.
I''m using this query:
$query_for_result=mysql_query("select * from matri_user_info where (gender='$gender') and (age between $agemin and $agemax) and (height between $hmin and $hmax) and (religion='$religion') and (marital_status='$marital_status') and (city ='$city') and (state='$state') and (country='$country');");
但是当某些列因为我采用和而留空时,它将显示0结果,并且它将通过获取每个变量值进行搜索,如果我采用OR,则它将显示甚至与任何列匹配的任何值.
所以我只想如果用户选择哪一个,它就会根据2的结果显示结果,依此类推.
如果您有任何想法,请告诉我.
感谢
But it show 0 result when some columns left blank because i take and and it will search by taking every variable value and if i take OR then it show any value even matched by any columns.
So i just want if user select even one the it show result according that if 2 then according that and so on.
If any of you have any idea then pls let me know.
thanks
推荐答案
query_for_result = mysql_query("
query_for_result=mysql_query("select * from matri_user_info where (gender='
gender')和(
gender') and (age between
agemin和
这篇关于查询以类似于婚姻搜索的方式进行搜索.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文