Outdated CMS plugins and custom PHP scripts are the #1 source of SQL injection vulnerabilities. Update everything—core, themes, plugins, and libraries.
If an attacker supplies id=1 UNION SELECT username, password FROM admin , the query becomes:
The attacker extracts:
Which of those would you like?
Instead of pasting the variable directly into the SQL string, you use a placeholder.