I am trying to query my database and find only the titles that start with the letter B and I'm using this php script. <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); $query = mysql_query("SELECT Anime_Name FROM Anime WHERE Anime_Name LIKE 'B%'"); $num_rows = mysql_num_rows($query); if($num_rows > 1) { while ($row = mysql_fetch_assoc($query)) { echo $row['Anime_Name'].'<br />'; } } else if($num_rows < 1) { echo "No Results"; } ?> Code (markup): And its returning nothing. I know there is a B in the column Anime_Name because I went and made one specifically named "B" just to test it. I also have the exact same script with SELECT Anime_Name FROM Anime WHERE Anime_Name LIKE 'A%' and it works fine. The only dif is its in its own <?php tags about 3 lines up. If I change the 'B%' to 'A%' it works fine. Is there something with LIKE that I am missing? Searching for any syntax examples on w3schools or tizag brings up nothing and they act like the command is not even there. Any help?
Hey, You said you have ONE B in the column. So I think you should replace this "if($num_rows > 1)" with this "if($num_rows >= 1)".