Created
June 18, 2020 23:03
-
-
Save zerobugs-oficial/2b1401935f4637560828edbc90f6e843 to your computer and use it in GitHub Desktop.
Conectar site PHP ao banco de dados MYSQL com mysqli
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 | |
$hostname = "localhost"; | |
$bancodedados = "bancodedados"; | |
$usuario = "usuario"; | |
$senha = "senha"; | |
$mysqli = new mysqli($hostname, $usuario, $senha, $bancodedados); | |
if ($mysqli->connect_errno) { | |
echo "Falha ao conectar: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment