Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP/SQL
#9
He's asking how to get a password from a SQL database.

Assuming you have a SQL database connection, use this query:

[lua]
$result = mysql_query("SELECT * FROM users WHERE username = '".mysql_real_escape_string($_POST['username'])."' AND password = '".hash('sha256',$_POST['password'])."'");

if (mysql_num_rows($result)) {
// success
} else {
// fail
}
[/lua]

Remember to hash your password. In the example I used sha256.
Reply


Messages In This Thread
PHP/SQL - by Dignity - 08-12-2011, 09:19 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)