Why is mysql_connect discouraged and what are the alternatives?

I am trying to learn about database management and MySQL through PHP. The problem is all the tutorials . I saw the use mysql_connectand according to the documentation , which is bad. What is the problem with using functions mysql_*and what are the alternatives? If there is a free online tutorial, send the link.

+5
source share
1 answer

You can use mysqli, and it imeans "Improved" to access your database, and it offers much more functions than just a connector mysql, and you can also use PDOwhich stands for PHP Data Objects, which I prefer, because it will allow you to use more than just MySQL as a database.

PDO Link
mysqli Link

+5
source

All Articles