I explode the input of user to array and then search them in the database but if user enter the space as a result it will show the whole rows of the table which has space how can I make it correct?
if(isset($_POST['submit'])){
$keywords = explode(" ", $_POST["search"]);
for ($i=0; $i<count($keywords); $i++) {
$query = "SELECT * FROM mp3s " .
"WHERE (artist LIKE '%".$keywords[$i]."%'
OR genre LIKE '%".$keywords[$i]."%'
OR album LIKE '%".$keywords[$i]."%'
OR filename LIKE '%".$keywords[$i]."%'
) ";
$sql = mysql_query($query) or die(mysql_error());
}