Preventing SQL Injection in PHP


Use parameterized queries with PDO to prevent SQL injection.

Source Code

$stmt = $pdo->prepare("SELECT * FROM users WHERE email = :email");
$stmt->execute(['email' => $userEmail]);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments