简体   繁体   中英

Best way to perform MySQL queries in PHP

Sorry, I've forgotten an important word here.

What is the most forgotten word way to perform MySQL Queries using PHP?

I read somewhere , that instead of using the old mysql_connect/mysql_query() statements, we should be using something else now! And the person who wrote that made it sound like we all should have known this by now.

I'm no expert on this stuff, but I really can't find anything about this.

I just remembered the word: efficient .

Any help at all is much appreciated. Any links/tuts/articles/code examples are very welcome. :)

Thank you!

改进的mysql(myqli)或PDO?

如今,建议使用mysqliPDO ,主要是因为它们支持参数化查询,如果使用得当,可以消除mySQL注入的风险。

Nowadays most applications are developed using an ORM like doctrine or propel. Internally most of them are using PDO....

I would highly recommend using PDO over mysql_* . There are plenty of tutorials out there, eg this one .

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