shan_cool Posted March 30, 2006 Share Posted March 30, 2006 Hi All, I am designing a form which has 3 text boxes and 21 combo boxes.It is a search engine where none of the fields are mandatory.I am using PHP with MYSQL 3.23,The purpose of this form is to check for the Employees who have Total Experience,Company experience and other experience.These 3 are Text boxes.The rest 21 combo boxes are various skill rating. Now i have to retrieve the employee Details based on the various combinations of text and combo boxes.As for now i have just tried the below if condition,which works finephp code[code]<?phpif( $tot_exp <> NULL && $mav_exp == NULL && $dev_exp == NULL && $core_banking == NULL....){$result = mysql_query("SELECT (TO_DAYS(CURRENT_DATE()) -TO_DAYS(Emp_DOJ))/365 as mav_exp,(TO_DAYS(CURRENT_DATE()) -TO_DAYS(Emp_DOJ))/365 + Test_Exp as tot_test,h.Emp_DOJ,s.Emp_Id as Emp_Id,s.Emp_Name as Emp_Name,s.Desgn as Desgn,s.Qual as Qual,s.Test_Exp,s.Dev_Exp,s.Other_ExpFROM skill_master s,HR_Emp_Det h where h.Emp_Id =s.Emp_Id and (TO_DAYS(CURRENT_DATE()) -TO_DAYS(Emp_DOJ))/365 + Test_Exp >='$tot_exp'",$connection) or die ("Can not do it1");$rs = mysql_num_rows($result);}?>[/code]but if i consider the above method for various combinations my code becomes very large and write more if conditions...My backend MYSQL does not support Sub queries,Is there anyother way to implement this???Thanks in advance,Shan[b]EDIT BY OBER: PLEASE USE CODE TAGS WHEN POSTING CODE[/b] Quote Link to comment https://forums.phpfreaks.com/topic/6161-search-criteria/ 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.