ksumanth Posted December 21, 2012 Share Posted December 21, 2012 I my form i have 4 fields like gender, fromage& toage, religion , caste. I need to search either one condition have to satisfy or two conditions have to satisfy or three condtions have to satisfy. I did like if all 3 conditions satisfy it will search. Can any one tell me how to My coding is $sql = "select * FROM profile_details where Caste='$caste' and gender='$gender' and Age between '$fromage' and '$toage'"; <? $selmetas=mysql_query($sql); if (mysql_num_rows($selmetas)>0) { while($resmetas=mysql_fetch_assoc($selmetas)) { $religion=$resmetas['religion']; $caste =$resmetas['Caste']; $Age=$resmetas['Age']; ?> <? } } else { ?> <? echo "No results found."; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/272246-search-while-submit/ Share on other sites More sharing options...
cpd Posted December 21, 2012 Share Posted December 21, 2012 You haven't 100% clarified what your trying to do but I'm guessing you want to begin searching the minute they select 1 item and to then restart the search when they select another item? Quote Link to comment https://forums.phpfreaks.com/topic/272246-search-while-submit/#findComment-1400724 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.