Are there any differences in the results of these two queries other than performance?
SELECT * FROM pet WHERE name LIKE 'Spot';
SELECT * FROM pet WHERE name = 'Spot';
Reason I ask is the real script will be something like the following and the API user is responsible to come up with the pattern. More often that not, a LIKE pattern will be provided, but there is always a chance that just a string will be provided resulting in SELECT * FROM pet WHERE name LIKE "Spot"
.
$stmt = $this->pdo->prepare('SELECT * FROM pet WHERE name LIKE ?');
$stmt->execute([$_GET['name']]); //Spot
return [$stmt->fetchAll(),200];