Skip to content

Instantly share code, notes, and snippets.

@welding3000
Created January 16, 2017 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save welding3000/7319fbd7ba6147480a9186f30e642fe0 to your computer and use it in GitHub Desktop.
Save welding3000/7319fbd7ba6147480a9186f30e642fe0 to your computer and use it in GitHub Desktop.
<html>
<body>
<?php
$db_host = " files.000webhost.com ";
$db_nombre = " database ";
$db_usuario = " root ";
$db_contra = " ";
$conexion = mysqli_connect($db_host,$db_usuario,$db_contra);
if(mysqli_connect_errno()){
echo " Error con la base de datos ";
exit();
}
mysqli_select_db($conexion, $db_nombre) or die ("no se encuentra la BBDD");
mysqli_set_charset($conexion,"utf8");
$consulta = " SELECT * FROM `DATOSPERSONALES`";
$resultados = mysqli_query($conexion, $consulta);
while($fila=mysqli_fetch_row($resultados)){
echo $fila[0] . " ";
echo $fila[1] . " ";
echo $fila[2] . " ";
echo $fila[3] . " ";
echo "<br>";
}
mysqli_close($conexion);
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment