mysqli_pconnect() function is used for making a persistent connection with the database that does not terminate when the script ends.
mysqli_connect() function searches any existing persistence connection first and if no persistence connection exists, then it will create a new database connection and terminate the connection at the end of the script.
$DBconnection = mysqli_connect("localhost","username","password","dbname");
// Check for valid connection
echo "Unable to connect with MySQL: " . mysqli_connect_error();
mysqli_pconnect() function is depreciated in the new version of PHP, but you can create a persistence connection using
mysqli_connect with the prefix p.