You need to move the if
statement to inside your loop, so that you are checking each book against the user's input.
I.e.
$author = $_GET['author'];
echo '<table border=1>'; //start table
$handle = fopen("books.csv", "r");
while (($books = fgetcsv($handle, 1000, ',')) !== FALSE)
{
if (strtolower ($author)==strtolower($books[1]))
{
echo '<tr><td>',$books[0], //names
'</td><td>',$books[1], //authors
'</td><td>',$books[2], //ISBN
'</td><td>',$books[3], //price
'</td></tr>';
}
}
fclose($handle);
echo '</table>'; //end table
You'll also need to add some logic for the case where there are no books which match the search parameters.