---
# System prepended metadata

title: How To Prevent SQL Injection?

---

# How To Prevent SQL Injection?
To avoid SQL injection flaws is simple. Developers need to either: a) stop writing dynamic queries; and/or b) prevent user supplied input which contains malicious SQL from affecting the logic of the executed query.

![](https://i.imgur.com/awZobed.png)

## 1: Input Validation

![](https://i.imgur.com/hR3vtHI.png)

## 2: Limiting Use Special Character

![](https://i.imgur.com/bk8aF9g.png)

## 3: Parameterized query

