Jump to content

search criteria


shan_cool

Recommended Posts

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

[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);
}
?>[/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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.