Jump to content

[SOLVED] Help with error :Resource id #10


Darkmatter5

Recommended Posts

Here's the code

 

<?php
  if(isset($_POST['code']) && isset($_POST['code'])) {
    $conn=mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');
      mysql_select_db($dbnameprim);
      $pagedb="members";
                  
      $code=$_POST['code'];
      $cntquery=mysql_query("SELECT COUNT(mem_username)
        FROM $dbnameprim.$pagedb
        WHERE activation_code='$code'
        ") or die(mysql_error());
      list($count)=mysql_fetch_array($cntquery);
      if($count==1) {
        mysql_query("UPDATE $dbnameprim.$pagedb
          SET activated='1'
          WHERE activation_code='$code'
          ") or die(mysql_error());
        $actquery=mysql_query("SELECT mem_username
          FROM $dbnameprim.$pagedb
          WHERE activation_code='$code'
          ") or die(mysql_error());
        $result=mysql_query($actquery) or die($actquery. '<br>' .mysql_error());
        $row=mysql_fetch_array($result);
        //echo "UPDATE $dbnameprim.$pagedb SET activated='1' WHERE activation_code='$code'<br>";
        echo "Thank you for activating your account $row[mem_username]!<br>
        You may now login with your username and password.";
      }
      else {
        echo "That activation code doesn't match any record on file!  Make sure you typed in the correct code.<br>
        If all else fails copy and paste the code from your activation email.";
      }
                  
      mysql_close($conn);
    }              
?>

 

When the ACTIVATE button is pushed it produces the following error.

 

"Resource id #10

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #10' at line 1"

 

Can someone help me troubleshoot this?

Link to comment
Share on other sites

There error is coming from here, I have highlighted the problem errors

$actquery=mysql_query("SELECT mem_username

          FROM $dbnameprim.$pagedb

          WHERE activation_code='$code'

          ") or die(mysql_error());

        $result=mysql_query($actquery) or die($actquery. '<br>' .mysql_error());

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.