PHP mysqli_change_user() Function

PHP mysqli_change_user() changes the user of the specified database connection.


bool mysqli_change_user(connection,user,password,db)

mysqli_change_user() Function Parameter

Connection :Required parameter. The MySQL connection to be used.
user :Required parameter. FALSE MySQL username.
password :Required parameter. MySQL password.
db :Required parameter. Database name to be changed.

mysqli_change_user() Function Return Value

Return Values :Returns TRUE on success or FALSE on failure.

mysqli_change_user() Function Example

$con = mysqli_connect("localhost","user","password","db");
if (mysqli_connect_errno())
	echo "Failed to connect to MySQL: " . mysqli_connect_error();
// reset all and select a new database
mysqli_change_user($con, "user", "password", "techno");