When you get association with MySQLi worker, it is needed to choose a specific data set to work with. This is on the grounds that there might be more than one data set accessible with MySQLi Server.
Syntax
bool mysqli_select_db( db_name, connection );
Sr.No. Parameter & Description
1
db_name
Required - MySQLi Database name to be selected
2
connection
Optional - if not specified, then last opened connection by mysqli_connect will be used.
Example
Here is the model telling you the best way to choose a data set.
<html>
<head>
<title>Connecting MySQLi Server</title>
</head>
<body>
<?php
$dbhost = 'localhost:3306';
$dbuser = 'root';
$dbpass = '<Password Here>';
$conn = mysqli_connect($dbhost, $dbuser, $dbpass);
if(! $conn ) {
echo 'Connected failure<br>';
}
echo 'Connected successfully<br>';
mysqli_select_db( 'TUTORIALS' );
//Write some code here
mysqli_close($conn);
?>
</body>
</html>
Whenever associated and Selected data set successfully,then the example yield ought to be this way −
Connected successfully