Possible Duplicate:
Best way to stop SQL Injection in PHP
MySQL injection protection and vulnerability signs using PHP
Hey i asked a question about my code if its vulnerable to sql injection The code was this :
$searchData = $_POST['searchData'];
$searchResult = mysql_query("SELECT * FROM songs WHERE songname LIKE '$searchData%' ");
echo $searchResult;
And yess everyone answered that it is ... but i wanted some extra help on how to protect this kind of input from sql injection. I read about mysql_real_escpape_string addslashes etc. But im confues which is the best one ? Shoud i combine them ... or how should i structure my code to protect the input Anyone helpin me with the best solution would be very apercciated.