From 1ea519a313a1ff81810def229857a9968815923d Mon Sep 17 00:00:00 2001 From: mauirixxx Date: Wed, 24 May 2017 22:10:34 -1000 Subject: [PATCH] may move while loop --- gw-login.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gw-login.php b/gw-login.php index b4d7da6..5d25675 100644 --- a/gw-login.php +++ b/gw-login.php @@ -11,7 +11,11 @@ if ($con->connect_errno > 0){ $sqllogin = "SELECT * FROM users WHERE users.username = '$username' and password = '$password'"; if ($result = $con->query($sqllogin)){ $row_cnt = mysqli_num_rows($result); - echo 'there were ' . $row_cnt . ' results!
'; + if ($row_cnt > 0){ + echo 'you should be logging in now!
'; //will move the while loop up to here if successful + } else { + echo 'That was not a valid username or password!
'; + } while ($row = $result->fetch_array()){ $uname = $row['username']; $uid = $row['userid'];