I have a SQL query:
SELECT id, title, file_name, file_path
FROM Image
WHERE title LIKE :search
The pdo sql request is prepared like this:
//$search is "karen"
$param = "%$search%":
$stmt = $db->prepare($query);
$executed = $stmt->execute(array(':search' => $param));
if(!$executed){
$error['error'] = $stmt->errorInfo();
echo json_encode($error);
exit();
}
My question is, will %karen% be interpreted as sql (where %karen% means 0 or more characters before the karen and 0 or more characters after the karen) or will this be literally interpreted as me searching for a title that has %karen%?