Przeglądaj źródła

may move while loop

development
mauirixxx 8 lat temu
rodzic
commit
1ea519a313
1 zmienionych plików z 5 dodań i 1 usunięć
  1. +5
    -1
      gw-login.php

+ 5
- 1
gw-login.php Wyświetl plik

@@ -11,7 +11,11 @@ if ($con->connect_errno > 0){
$sqllogin = "SELECT * FROM users WHERE users.username = '$username' and password = '$password'"; $sqllogin = "SELECT * FROM users WHERE users.username = '$username' and password = '$password'";
if ($result = $con->query($sqllogin)){ if ($result = $con->query($sqllogin)){
$row_cnt = mysqli_num_rows($result); $row_cnt = mysqli_num_rows($result);
echo 'there were ' . $row_cnt . ' results!<BR>';
if ($row_cnt > 0){
echo 'you should be logging in now!<BR>'; //will move the while loop up to here if successful
} else {
echo 'That was not a valid username or password!<BR>';
}
while ($row = $result->fetch_array()){ while ($row = $result->fetch_array()){
$uname = $row['username']; $uname = $row['username'];
$uid = $row['userid']; $uid = $row['userid'];


Ładowanie…
Anuluj
Zapisz