Quick Answer
SQL injection: attacker adds SQL code in user input that gets executed by the database. Prevention: always use prepared statements (parameterized queries): $stmt = $pdo->prepare("SELECT * FROM users WHERE email = ?"); $stmt->execute([$email]). Never concatenate user input into SQL strings. Also: validate/sanitize input, use least-privilege DB accounts, and escape output properly.
Answer
SQL injection manipulates queries using malicious input. Prevent using prepared statements with bound parameters.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
PHP interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Ideal for freshers and experienced candidates preparing for PHP roles.