Created
January 29, 2018 15:54
-
-
Save oneberto/13e8d969670a0ebb11a37650bf2f9338 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
$servidor = 'localhost'; | |
$usuario = 'root'; | |
$senha = ''; | |
$banco = 'mydb'; | |
$mysqli = new mysqli($servidor, $usuario, $senha, $banco); | |
// Executa | |
$sql = "SELECT * FROM dados"; | |
$query = $mysqli->query($sql); | |
while ($dados = $query->fetch_array()) { | |
echo 'ID: ' . $dados['id'] . ''; | |
echo 'Texto: ' . $dados['texto'] . ''; | |
} | |
echo 'Registros encontrados: ' . $query->num_rows; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment