Reputation: 8085
I have gone back to some basic PDO after using Laravel for a few months and hit issues already.
Example is this code:
try {
$conn = new PDO('mysql:host=127.0.0.1;dbname=every_hour', 'root', 'root');
$query = "INSERT INTO votes (image_id, created_at) VALUES (:image_id, '22'";
$q = $conn->prepare($query);
$q->execute(
[
':image_id' => $image_id
]);
$return['success'] = true;
} catch(PDOException $e) {
echo json_encode($e->getMessage());
}
As you can see the last bracket is missing from the query.
But this isn't throwing any errors... whats missing?
Upvotes: 2
Views: 58