mysql_query("SELECT * FROM table WHERE msg LIKE '%". str_replace(" ", "%' OR msg LIKE '%", $text) ."%'"