SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Oct 2010
    Posts
    323
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in

    please i am having this error, i am trying to create a login page , but once you register it sends the email to the registered email
    once the link is clicked it says the account is acitatvated but with this message below


    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/reachea2/public_html/activate.php on line 11

    PHP Code:
    <?php
     
    include 'include/global.php';

        
    $code $_GET['code'];

        if (!
    $code)
            echo 
    "No code supplied";
        else
        {
            
    $check mysql_query("SELECT * FROM users WHERE code='$code' AND active='1'");
            if (
    mysql_num_rows($check)==1)
                echo 
    "You have already activated your account";
            else
            {
                
    $activate mysql_query("UPDATE users SET active='1' WHERE code='$code'");
                echo 
    "Your account has been activated!";
            }
            
        }
        
    ?>

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    It means that the query has failed in some way. Use mysql_error() to tell you what the problem is.
    Code:
     $check = mysql_query("SELECT * FROM users WHERE code='$code' AND active='1'")or die(mysql_error());

    See what it says
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Addict
    Join Date
    Oct 2010
    Posts
    323
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    thanks i echoed it i realised i didnt spell the table name well, so i adjusted it and it was aiit


Bookmarks

Posting Permissions

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