How can the use of LIKE in SQL queries with PDO prepared statements be optimized to handle fuzzy searches for multiple results?

When using the LIKE operator in SQL queries with PDO prepared statements for fuzzy searches, it is important to optimize the query for performance. One way to handle fuzzy searches for multiple results is to use placeholders in the prepared statement and bind the search term with wildcards directly in the bindValue function. This allows for flexibility in the search term and avoids the need to concatenate wildcards in the SQL query.

$searchTerm = "%{$searchTerm}%";
$stmt = $pdo->prepare("SELECT * FROM table_name WHERE column_name LIKE :searchTerm");
$stmt->bindValue(':searchTerm', $searchTerm, PDO::PARAM_STR);
$stmt->execute();
$results = $stmt->fetchAll();