简体   繁体   中英

A secure PHP class connecting to MySQL?

有人可以为数据库交互推荐一些简单安全的PHP / MySQL数据库类吗?

Here at work we use PDO for that kind of things. Clear enough imho

http://www.php.net/manual/en/intro.pdo.php

你也可以使用mysqli类:)

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().

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM