Last active
August 29, 2015 14:01
-
-
Save FraGoTe/0bbdc59dc47f2e734705 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 | |
//Conexion a la base de datos | |
mysql_connect("localhost","usuarioBaseDeDatos","claveBaseDeDatos"); | |
mysql_select_db("nombreDeLaBaseDeDatos"); | |
//Fin de la conexión a la base de datos | |
$username = "aragonc"; | |
$password = "admin"; | |
//Query a la tabla user filtrando por username y password | |
$sql="SELECT * FROM user WHERE (username='$username' AND password='$password')"; | |
$res = mysql_query($sql); | |
$row = mysql_fetch_array($res); | |
if( mysql_query($sql) ) { | |
; | |
// ok! | |
} else { | |
echo "Has tenido el siguiente error:<br />".mysql_error(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment