Name: DOMMIT FRONK 2013-02-16 17:20
$username = $_POST['username'];
$pass = $_POST['password'];
//Connect to MySQL
$mysqli = new mysqli("localhost", "username", "password", "databasename");
if ($mysqli->connect_errno)
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
//Validate user
$query = "SELECT Hash, Salt FROM USERS WHERE UserName = ?";
$stmt = $mysqli->prepare($query);
$stmt->bind_param('s', $username);
$stmt->execute();
$stmt->bind_result($userHash, $userSalt);
$stmt->close();
$mysqli->close();I use pretty much the exact same format to perform inserts into this table (which works just fine), but for some reason $userHash and $userSalt always end up null, what gives? D:
This is the beginning of my validation upon login, which is hard to do when the select query isn't giving me anything >_<