www.webdeveloper.com
Results 1 to 3 of 3

Thread: Why is error with activation of account?

  1. #1
    Join Date
    Sep 2005
    Posts
    1,635

    Question Why is error with activation of account?

    I have code when user clicks on link in his email and activates account.
    error is:
    PHP Code:
    Warningmysql_fetch_array(): supplied argument is not a valid MySQL result resource in activationuser.php on line 25 
    Line 25 is: while ($row = mysql_fetch_array($result)) and all code:

    PHP Code:
    $query "SELECT * FROM membership WHERE activationnum = '$accountnum'";
      while (
    $row mysql_fetch_array($result))
    {           
    $activation $row["activation"];
             if (
    $activation==1)

          {   echo 
    "<script language='javascript'>
                        document.location='index.php';</script>"
    ;  }

           else
            {
                
    $query "UPDATE membership SET activation ='1'
                WHERE activationnum = '
    $accountnum'";
                
    $resultmysql_query ($query) or die ('Can not complete update');

             }
     } 
    I have to redirect user to index.php page if he clicks twice on link in his e-mail. So, only once can be pressed on link.

  2. #2
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,742
    Because you haven't run a query. You need the following on the second line of your post.
    PHP Code:
    $result mysql_query($query); 

  3. #3
    Join Date
    Sep 2005
    Posts
    1,635
    Thanks, it works now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles