Hi Guys I've got a problem in my search engine. Here's the code:
$types = mysql_real_escape_string($_GET['type']);
//Convertion de GET
if ($types = "air") {
$searchq = "LF";
}elseif ($types = "huile") {
$searchq = "OF";
}elseif ($types = "carburant") {
$searchq = "KF";
}elseif ($types = "habitacle") {
$searchq = "CF";
}elseif ($types = "eau") {
$searchq = "WF";
}else{
$searchq = "DF";
}
$searchq = preg_replace("#[^0-9a-z]#i", "", $searchq);
$query = mysql_query("SELECT * FROM tProduct WHERE sSearch LIKE '%$searchq%'")
or die("La Recherche est impossible");
$count = mysql_num_rows($query);
$result = mysql_query("SELECT * FROM tProduct WHERE sSearch LIKE '%$searchq%'");
But the problem is that searchq
takes only the value of LF
.
Where is the problem in my code please?