Why is “mysql_connect” discouraged and what are the alternatives?

我的未来我决定 提交于 2019-12-07 06:09:11

问题


I'm trying to learn about database management and MySQL through PHP. The problem is all the tutorials I've seen use mysql_connect and according to the documentation that's bad. What is the problem with using mysql_* functions and what are the alternatives? If there are any free online tutorial please post the link.


回答1:


You can try using mysqli the i stands for Improved to access to your Database and it offers a lot more functions than just the mysql connector, or also you can use PDO wich stands for PHP Data Objects which is the one i prefer because it will let you use more than just MySQL as a database.

PDO Link
mysqli Link



来源:https://stackoverflow.com/questions/11679033/why-is-mysql-connect-discouraged-and-what-are-the-alternatives

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!