Doubt Mysqli Parameter new_link

Asked

Viewed 42 times

2

The old PHP function mysql_connect possessed the parameter new_link which 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 does it not need?

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

I searched the documentation but did not locate.

2 answers

1


Every instance mysqli is completely independent of each other and therefore every db connection of an instance is a new_link. Therefore, there is nothing equivalent to new_link in the mysqli.

0

The fourth argument of the function mysql_connect() serves to force php to create a new connection, the default behavior is a call mysql_connect() it returns the connection, in the case of a second with the same information(server, password user) it returns the same connection, in the mysqli extension there is no such parameter.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.