Hi,
i have 8 fields as
Gender: Bride Groom
Age : From To
Height: From To
Religion:
Marital Status:
City:
State:
Country:
Search button.
I want a search query for this which take value from these fields and search according.
like if anyone want a search with only two fields or 3 fields etc etc he and she can get result according.
I have used these code but yet not get the exact result.
Is Query 1 in correct format?
Query 1:
$query_for_result=mysql_query("select * from matri_user_info where (gender='$gender') and if($agemin='' and $agemax='') then (age between 18 and 100 )else (age between $agemin and $agemax) and if($hmin='' and $hmax='')then (height between 0 and 7 else (height between $hmin and $hmax) and if(religion='')then (religion !='') else(religion='$religion') and if (marital_status='')then (marital_status !='')else (marital_status='$marital_status') and if((city ='') then (city !='') else (city ='$city') and if (state='')then (state !='')else (state='$state') and if(country='')then(country !='') else(country='$country');");
Query 1:
SELECT *FROM pages WHERE MATCH(gender, age,height,religion,marital_status,city,state,country) AGAINST ('$gender','between $agemin and $agemax','between $hmin and $hmax','$religion','$marital_status','$city','$state','$country' IN BOOLEAN MODE)
Query 3:
$query_for_result=mysql_query("select * from matri_user_info where (gender='$gender') or (age between $agemin and $agemax) or (height between $hmin and $hmax) or (religion='$religion') or (marital_status='$marital_status') or (city ='$city') or (state='$state') or (country='$country');");
Query4:
$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 (status='unlock');");
If anyone has the answer for this? Please Share with me, i am searching for this since long.
Thanks