-
-
Save TannicArcher/4533a0c2fea595668974a4aaa4206ca6 to your computer and use it in GitHub Desktop.
MYSQLi connect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$servername = "ваш_хост"; | |
$username = "ваше_имя_пользователя"; | |
$password = "ваш_пароль"; | |
$dbname = "ваша_база_данных"; | |
// Создаем подключение | |
$conn = new mysqli($servername, $username, $password, $dbname); | |
// Проверяем соединение | |
if ($conn->connect_error) { | |
die("Connection failed: " . $conn->connect_error); | |
} | |
echo "Connected successfully"; | |
// Закрываем соединение | |
$conn->close(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment