On my MySQL search what I want to do is redirect a user to another page and show an error message if the search returned no results. But for some reason the user never gets redirected.
Can you spot my problem? :|
$sql = "SELECT * FROM `list` WHERE `title` LIKE '%".$search[0]."%' AND `url` LIKE '%".$sites[0]."%'";
$catcnt = mysql_fetch_row(mysql_query($sql));
if($catcnt[0] == ''){header('Location: index.php');}else{echo $catcnt[0];}