hi all,
i am trying a query but i am not getting the result properly..
Is there any error in my query..
$query ="select Emp_Id,First_Name,Last_Name,Gender,Mobile_No,Email_Id,Blood_Group from Employee where";
if($empid!='')
{
$query1=$query . " Emp_Id like '".$empid."%' and";
// echo $query1;
}
if($empname!='')
{
$query1=$query . " First_Name like '%".$empname."%' and";
}
if($empname!='')
{
$query1=$query . " Last_Name like '%".$empname."%' and";
}
if($mobileno!='')
{
$query1=$query . " Mobile_No like '%".$mobileno."%' and ";
// echo $query1;
}
if($bloodgroup!='')
{
$query1=$query . " Blood_Group like '".$bloodgroup."%'";
}
$query2= mysql_query($query1);
mysql_error();
$num=mysql_num_rows($query2);
echo $num;
Thank u.