Im simply trying to add a "AND" conditional to a sql query before a "LIKE" conditional
Code: Select all
//this is the basic set up in generic form so you can see it with a little less code and grasp the concept
$sWhere = "WHERE status = 'Active' AND label LIKE '%".mysqli_real_escape_string($connect, $xVariable)."%' OR ".
"status = 'Active' AND point LIKE '%".mysqli_real_escape_string($connect, $x2Variable )."%' OR ".
"status = 'Active' AND city LIKE '%".mysqli_real_escape_string($connect, $y2variable)."%'; ";
}
$sQuery = "
SELECT *
FROM camp
$sWhere
";
//this is the real form
$sWhere = "WHERE status = 'Active' AND label LIKE '%".mysqli_real_escape_string($gaSql['link'], $_GET['sSearch'] )."%' OR ".
"status = 'Active' AND point LIKE '%".mysqli_real_escape_string($gaSql['link'], $_GET['sSearch'] )."%' OR ".
"status = 'Active' AND city LIKE '%".mysqli_real_escape_string($gaSql['link'], $_GET['sSearch'] )."%'; ";
}
$sQuery = "
SELECT *
FROM camp
$sWhere
";
basicly the AND statement isn't even considered I don't get an error or anything
it basicly ignores it so it could have it or not have and the statement is overlooked entirely
any ideas???