有时mysql全文搜索不应该返回任何结果

My MySQL database table contains 2510 records. When I try to search for a string in a column, using fulltext search, sometimes, I don't get any results. Just an empty html table.

For example, I'm searching for the author 'Peter Schmidt'. If I search for 'Peter' I'll get the right author, but if I search for 'Schmidt', the html table shows other authors, but not the right one. The author's column consist of 'surname, name' (Schmidt, Peter).

This is a piece of my code:

    $author = mysql_real_escape_string($_GET['author']);
    $sql = "SELECT * FROM books WHERE MATCH(author) AGAINST ('$author' IN BOOLEAN MODE)";
    $query = mysql_query($sql);
    if (!$query) {
        echo 'We cannot find the author you are searching for. Please try again.';
        echo '<a href="'.$_SERVER['PHP_SELF'].'" class="back" style="margin:0;" title="Go back">&raquo; Go back</a>';

    } else {
        echo '<p>These authors match your query:</p><table>'
        while ($result = mysql_fetch_array($query)) {
                echo '<tr><td>'.$result['author'].'</td></tr>';
        }
        echo '</table>'
    }

What causes this issue?

Try not to use BOOLEAN MODE matching if you dont know syntax for it. As also check for proper encoding in php/mysql connection:

<?php
mb_internal_encoding("UTF-8");
mysql_query("SET character_set_client = utf8;");
mysql_query("SET character_set_results = utf8;");
mysql_query("SET collation_connection = utf8_general_ci;");
$author = mysql_real_escape_string($_GET['author']);
$sql = "SELECT * FROM books WHERE author LIKE '%$author%'";
$query = mysql_query($sql);
if (!$query) {
    echo 'We cannot find the author you are searching for. Please try again.';
    echo '<a href="'.$_SERVER['PHP_SELF'].'" class="back" style="margin:0;" title="Go back">&raquo; Go back</a>';
} else {
    echo '<p>These authors match your query:</p><table>'
    while ($result = mysql_fetch_assoc($query)) {
            echo '<tr><td>'.$result['author'].'</td></tr>';
    }
    echo '</table>'
}
?>