Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2011
    Posts
    141
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Warning: mysql_num_rows(): supplied argument

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/friendko/public_html/development/load/checklogin.php on line 15


    Code:
    <?php
    
    include("dbsettings.php");
    mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
    mysql_select_db("$db_name")or die("cannot select DB");
    
    
    
    $sql=("SELECT * FROM tbl_name WHERE username='$username' AND password='$md5password'");
    
    
    
    $result=mysql_query($sql);
    
    if (mysql_num_rows($result) == 1)
    
    {
    
    
    $_SESSION['username'];
    $_SESSION['password'];
    
    echo '<META HTTP-EQUIV="Refresh" Content="0" URL="account.php?success">'; 
    }
    else {
    echo "Wrong username/password. Please try again.";
    }
    ?>

  • #2
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,447
    Thanks
    71
    Thanked 102 Times in 101 Posts
    You keep double posting, why?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •