Results 1 to 2 of 2

Thread: Can't get this error...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    296

    Can't get this error...

    Warning: Wrong parameter count for mysql_result() in /home/djstop/public_html/test/phatfx.php on line 252

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/djstop/public_html/test/phatfx.php on line 254


    PHP Code:

        case "admin_login" :

            myconnect();
        $query = "SELECT * FROM `members` WHERE `username` = '$username' AND `password` = '$password' LIMIT 1";

        $result = mysql_result($query);

        if (mysql_num_rows($result) == 0) {
        echo "<center>Sorry, Username and password do not match. Being redirected to main page.</center>";
    ?>
        ///////////////////////////////
    <?
            } else {
        session_start();
        session_register(username);
        session_register(password);
        echo "<center>You were logged in successfully, Being redirected to the admin section!</center>";
        ?>
        <meta http-equiv="REFRESH" content="0; url=phatfx.php?action=admin_loggedin" target="_self">
    <?
        

        }
            myclose();
    break;

    With that, I get the 2 errors I posten in the top of this thread. Can someone please help me? Thanks!
    Kevin Carpenter
    Currently Working in the CAOS (CA Operating System) Group

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    You need to change it to "mysql_query" not mysql_result:

    PHP Code:
    case "admin_login" :

        
    myconnect(); //I don't know what this is??
        
    $query "SELECT * FROM `members` WHERE `username` = '$username' AND `password` = '$password' LIMIT 1";

        
    $result mysql_query($query);

        if (
    mysql_num_rows($result) == 0) { 
    and also, you don't need the `around table and field names:

    PHP Code:
    case "admin_login" :

        
    myconnect(); //I don't know what this is??
        
    $query "SELECT * FROM members WHERE username='$username' AND password='$password' LIMIT 1";

        
    $result mysql_query($query);

        if (
    mysql_num_rows($result) == 0) { 
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

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



Click Here to Expand Forum to Full Width