Created
February 13, 2014 09:10
-
-
Save tanrax/8972076 to your computer and use it in GitHub Desktop.
PHP: Consulta MySQL (SQL)
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 | |
/* Conexion */ | |
$conexion = mysql_connect('localhost', 'root', ''); | |
mysql_select_db('nombreBBDD', $conexion); | |
/* Consulta */ | |
$sSQL = "SELECT * FROM"; | |
$resultados = mysql_query($sSQL, $conexion) or die(mysql_error()); | |
/* Obtener datos */ | |
while($row = mysql_fetch_assoc($resultados)) { | |
echo $row['id']; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment