connect_errno > 0){ die ('Unable to connect to database [' . $db->connect_errno . ']'); } $sqllogin = "SELECT * FROM users WHERE users.username = '$username' and password = '$password'"; if ($result = $con->query($sqllogin)){ $row_cnt = mysqli_num_rows($result); if ($row_cnt > 0){ while ($row = $result->fetch_array()){ $uname = $row['username']; $uid = $row['userid']; $access = $row['access']; $_SESSION['username'] = $uname; $_SESSION['userid'] = $uid; $_SESSION['access'] = $access; echo 'Proceed to character selection here
'; //really should automate this } } else { echo 'That was not a valid username or password!
'; echo 'Please try again here'; } } ?>