Created
April 30, 2015 10:36
-
-
Save manviny/1be913fbb6ea61dddd3b to your computer and use it in GitHub Desktop.
connect BD desde PHP mysqli
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
$mysqli = new mysqli('localhost', 'bn_processwire', 'd1ac70ac0d', 'bitnami_processwire'); | |
<?php | |
/* | |
* Use esto en lugar de $connect_error si necesita asegurarse | |
* de la compatibilidad con versiones de PHP anteriores a 5.2.9 y 5.3.0. | |
*/ | |
if (mysqli_connect_error()) { | |
die('Error de Conexión (' . mysqli_connect_errno() . ') ' | |
. mysqli_connect_error()); | |
} | |
echo 'Éxito... ' . $mysqli->host_info . "\n"; | |
while ($row = $result->fetch_array()){ | |
echo $row[0]; | |
} | |
$mysqli->close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment