PDA

View Full Version : How to protect mysql from hackers?


Yahook
05-04-2005, 08:03 PM
Which function shoud I use for data before I add it to mysql database to protect it from hackers? :?:

xariton
05-04-2005, 09:53 PM
mysql_escape_string should help.
This function will escape the unescaped_string, so that it is safe to place it in a mysql_query().

AoshiShinomori
08-22-2007, 09:38 AM
good password like : HiO0O3DnZN5ns23kJahs that would do it.

lolCoin
09-08-2008, 10:07 AM
do somebody can work it??

Corex
09-08-2008, 01:30 PM
mysql_real_escape_string() is better than mysql_escape_string(). Also, you can use htmlspecialchars() with ENT_QUOTES option.
Good practice is to create one function or class working with database. Inside this function/class you can build some security handler and all DB-requests should be called through this function/class.

poornpig
09-08-2008, 01:41 PM
If the lang you use does not offer escaping functions you can take a look at <buzzword>prepared statements</buzzword>, if this is offered.

Oh and you should subscribe to security mailinglists to get informations about bugs fast.