Anti MySQL Injection Function in PHP

How to Avoid MySQL Injection

This PHP function will clean mysql injection codes in the input field. This will help our website free from SQL Injection.
//source code anti mysql injection function function anti_sqlinjection($dirty){
if (get_magic_quotes_gpc())
$clean = mysql_real_escape_string(stripslashes($dirty));
$clean = mysql_real_escape_string($dirty);
return $clean;

Related Topic How to Protect MySQL Injection
How to Prevent SQL Injection Attacks
How to Prevent from MySQL Injection in PHP
Network Security Management for Large Government, School, Businesses and Homes
List of Mysql Error Code and Description
SQL  PHP  MySQL 2011   Privacy Policy  Terms of Service  Feedback