Why is mysqli_ better than mysql_? [duplicate]

3

I would like to know what are the advantages that mysqli_ has in relation to mysql_ , as it is suggested to me directly to mysqli_ .

    
asked by anonymous 15.07.2015 / 15:28

3 answers

3

MySQL functions are deprecated, so MySQLi functions end up being new, secure, have new features and are object oriented. MySQLi is an evolution of MySQL .

There is still an alternative to MySQLi which is PDO (driver that implements the PHP Data Objects interface) that allows you to work with multiple databases in a transparent way.

    
15.07.2015 / 15:36
3

I do not think you have any idea what mysqli_ and mysql_ . This is not different DBMS. They are libraries (extensions) of access to a MySQL database through PHP. The difference is that functions like mysql_ will be discontinued and the improvements mysqli_ to replace.

    
15.07.2015 / 15:50
1

By title putting it in the manual on the mysqli library, I will reply in a very simple way:

  

Why mysqli_ is better than mysql _?

Because, according to the manual, it is:

  

Enhanced MySQL Extension

See here in this link

I have other words: the Mysqli extension is the evolution of the Mysql extension for PHP.

In this case, I advise you to leave your code with mysqli , since the mysql extension has already been deprecated (and its use becomes discouraged by PHP personnel).

    
15.07.2015 / 15:53