:]]' AND "; } //remove the trailing “AND” [“-4” = (1 space + 3 characters)] $WhereClause = substr($WhereClause, 0,strlen($WhereClause)-4 ); include '/home/account/MySQLconnections/books2.php'; $query = ("SELECT * FROM title WHERE ".$WhereClause.""); $result = mysql_query($query); //the number of results: $totalrows = mysql_num_rows($result); if ($totalrows === 0) { print "Sorry. Your search for $keywords returned no results."; } else { print "Your search returned $totalrows results.

"; } while ($row = mysql_fetch_object($result)) { echo $row->author_last; echo "
"; } } ?>