Created
January 29, 2017 20:28
-
-
Save CloudyWater/80975b184df58246e8b4b7e5b0e5c349 to your computer and use it in GitHub Desktop.
Our script to get user data
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 | |
$db = mysql_connect('localhost', 'username', 'password') or die ('Could not connect: ' . mysql_error()); | |
mysql_select_db('databasename') or die ('Could not select database'); | |
$username = mysql_real_escape_string($_GET['username'], $db); | |
$query = "SELECT * FROM users WHERE username='$username';"; | |
$result = mysql_query($query) or die ('Query failed: ' . mysql_error()); | |
$row = mysql_fetch_assoc($result); | |
echo $row['password']; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment