How To Prevent Sql Injection Attacks In Mysql
- Forums
- MYSQL
- How To Prevent Sql Injection Attacks In Mysql
This Page Contains information about How To Prevent Sql Injection Attacks In Mysql By sqljaks in category MYSQL with 1 Replies. [2291], Last Updated: Mon Jun 24, 2024
sqljaks
Sat Sep 13, 2008
1 Comments
369 Visits
hi i have a website with php and mysql, and i just learned about sql injection where your website can get hacked by simple puting this on the username and password..
' or 1=1--
how can i avoid or stop sql injections from happening to my website
mysql_real_escape_string()
so lets say that the username is the name of the field in your login form, im guessing you are using the POST method so this is how you would stop it
$myusername = mysql_real_escape_string($_POST['myusername']);
now you will stop from being hacked
hope that helps
https://www.webune.com/forums/how-to-prevent-sql-injection-attacks-in-mysql.html