Doubt MySQLi Paramento new_link

2

The old PHP function mysql_connect had the new_link parameter that allowed connection to several different banks in the same script :

Example:

$connect = mysql_connect($host,$user,$pass,$new_link);

How does this work in mysqli? Does it have this parameter? Or do not you?

$mysqli = new mysqli($host, $user, $pass, $database);

I searched the documentation but could not find it.

    
asked by anonymous 15.07.2015 / 17:13

2 answers

1

Each mysqli instance is completely independent of each other, so each db connection of an instance is new_link . Therefore, there is nothing equivalent to new_link in mysqli .

    
15.07.2015 / 17:50
0

The fourth argument of the mysql_connect() function is to force php to create a new connection, the default behavior is a mysql_connect() it returns the connection, in the case of a second with the same information (server, user password ) it returns the same connection, in the extension of mysqli does not exist this parameter.

    
15.07.2015 / 17:52