PHP mysqli_connect() trong PHP
Example
Open a new connection to the MySQL server:
<?php
$con = mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>PHP Version: 5+
Nguồn: https://www.w3schools.com/php/func_mysqli_connect.asp
Tham khảo thêm: http://php.net/manual/en/function.mysqli-connect.php
