Knowledgebase:MySQLi
Fungsi mysqli_connect()
Posted by Ari Sigit on 10 June 2019 11:36 am
Definisi dan Penggunaan
Fungsi mysqli_connect () membuka koneksi baru ke server MySQL.
Contoh Script:
<?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();
}
?>