Hi,
I tried to work this query out for a while but till now i still couldn't find what actually went wrong.
This search query has 2 search query option.
1) wildcard text search box
2) drop down list option
A user can either choose to search by (1) or (2) individually or both (1) and (2) to filter out even more. Howevery this search query can only serach individually but not both at the same time.
Can anyone able to help me out??
Cheers
if (trim($val_d) != '' or trim($val_sub) != ''){
$sql = "SELECT *
FROM wsdevice ";
if (trim($val_d) != ''){
$sql .= " WHERE wsdevice_num like '%$val_d%'"; }
else if (trim($val_sub) != ''){
$sql .= " WHERE wsdevice_subconid = '$val_sub'";
}
else {
$sql .= " WHERE ((wsdevice_num like '%$val_d%' )and (wsdevice_subconid = '$val_sub')) ";
}