I have written a mysqli statement for advanced search of my website. the generated query does not work. here is the generated query:
SELECT title, stars, pic_main, id, province FROM ads WHERE 'province' = 8 AND( title LIKE %شریف% OR content LIKE %شریف% OR keywords LIKE %شریف% OR title LIKE %شریف%)
And here is the code that I use to execute the query:
if($transorder = $site_db->query($statement))
{
echo "True";
$i=0;
while($row_obj = $transorder->fetch_object())
{
$item[$i]['id'] = $row_obj->id;
$item[$i]['pic_main'] = $row_obj->pic_main;
$item[$i]['title'] = $row_obj->title;
$item[$i]['province'] = $row_obj->province;
$item[$i]['stars'] = $row_obj->stars;
$i++;
}
}
else
{
echo "False";
}