Jump to content


Photo

search criteria


  • Please log in to reply
No replies to this topic

#1 shan_cool

shan_cool
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts
  • LocationChennai,India

Posted 30 March 2006 - 07:27 AM

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 fine

php code

<?php
if( $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_Exp
FROM 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);
}
?>
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

EDIT BY OBER: PLEASE USE CODE TAGS WHEN POSTING CODE




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users