Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is "mysql_connect" discouraged and what are the alternatives?

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.

like image 803
Celeritas Avatar asked Jul 26 '12 22:07

Celeritas


1 Answers

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

like image 76
Isaac Gonzalez Avatar answered Oct 03 '22 08:10

Isaac Gonzalez