How is this best fixed?
query = "SELECT * FROM u WHERE id=" + input
- Use parameterized queries
- Trust the client input
- Hide the SQL errors
- Rename the table columns
Prepared statements separate code from data, preventing SQL injection.
Play Cybersecurity ▸