Membuat koneksi di php versi 7Dibuat
Login Terakhir
5 Tahun lalu,
Telah Dilihat 2557 Kali
| |
Sultan Account |
|
|
M ibrahim bajuri
Mengatakan :
Sultan Account
gan bagaimana cara membuat koneksi di php versi 7 soalnya sintak yang biasa di gunakan tidak bisa di gunakan dan mencul error yang fatal terus mohon solusinya maaf screenshotnya ga ada |
|
| Unggul Cahya S commented on 03 Jul 2016 11:40:20 Sultan Account |
|
|
|
mysql_connect — Open a connection to a MySQL Server
Warning
This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead
<?php
$link = mysqli_connect("127.0.0.1", "my_user", "my_password", "my_db");
if (!$link) {
echo "Error: Unable to connect to MySQL." . PHP_EOL;
echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
exit;
}
echo "Success: A proper connection to MySQL was made! The my_db database is great." . PHP_EOL;
echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL;
mysqli_close($link);
?>
http://php.net/manual/en/function.mysqli-connect.php |
|