Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Warning: mysql_fetch_assoc() expects parameter 1 to be resource, object given
- $username = $_POST['username'];
- $password = $_POST['password'];
- if($username&&$password)
- {
- require 'conn.php';
- $query = "SELECT * FROM users WHERE username='$username'";
- $result = $mysql->query($query) or die(mysqli_error($mysql));
- $numrows = $result->num_rows;
- if ($numrows!=0)
- {
- while($row = mysql_fetch_assoc($result))
- {
- $dbusername = $row['username'];
- $dbpassword = $row['password'];
- }
- //check to see if they match!
- if($username==$dbusername&&$password==$dbpassword)
- {
- echo "youre In!";
- }
- else
- echo "incorrect password!";
- }
- else
- die("that user is dead");
- //echo $numrows;
- }
- else
- echo ("Please Enter Username")
- while($row = mysql_fetch_assoc($result))
- while($row = $result->fetch_assoc())
- $row = $result->fetch_assoc();
Add Comment
Please, Sign In to add comment