Search form sample pattern
Here's a recommendation to bind parameters correctly. This sort of thing is used to prevent against SQL injection attacks.

$query = "SELECT * FROM table WHERE name = :keyword";  
$statement = $this-&gt;pdo-&gt;prepare($query);
$statement-&gt;bindParam(':keyword', $keyword, PDO::PARAM_STR);
$result $statement-&gt;execute();  


Read more about PDOStatement#bindParam here