A secure PHP class connecting to MySQL?
Can someone recommend some simple and secure PHP开发者_如何学JAVA/MySQL Database class for the database interaction?
You could also just use the mysqli class :)
Here at work we use PDO for that kind of things. Clear enough imho
http://www.php.net/manual/en/intro.pdo.php
Check out MDB2....
http://pear.php.net/package/MDB2
All extensions (mysql, mysqli, pdo_mysql) are safe, if you use them correctly!
We use PDO, though, which appears to be the easiest one: http://php.net/manual/en/book.pdo.php Just remember to use prepared statements (which are "100% safe" against SQL Injections, when used correctly). If you can't use them, at least use methods like PDO::quote().
精彩评论