vendredi 24 juillet 2015

Undefined variable: | mysql_fetch_array() expects parameter 1 to be resource, boolean given in

if (isset($_POST['register'])){
if ($_POST['username'] && $_POST['password']){
    $password = mysql_real_escape_string(hash("sha512", $_POST['password']));
    $username = mysql_real_escape_string($_POST['username']);
}
$check = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `Username`='$username'"));
if ($check != '0'){

Notice: Undefined variable: username in C:\xampp\htdocs\DB\register.php on line 36

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\DB\register.php on line 36

Notice: Undefined variable: username in C:\xampp\htdocs\DB\register.php on line 38 That username already exists! Try ''13 instead! Back

Anyone know what is causing this to happen and note that this is just part of the code. Obviously :)

Aucun commentaire:

Enregistrer un commentaire