Altec Posted November 23, 2007 Share Posted November 23, 2007 I have the following code: $query1 = mysql_query("SELECT `ID` FROM `members` WHERE username = '{$username}' LIMIT 1;"); if ($query1) { $memid = $query1; // E-mail message $subject = 'Activation required for Ballistic Designs'; $message = 'Dear '.$username.',\n'; $message .= 'Thank you for registering at Ballistic Designs. Before we can activate your account one last step must be taken to complete your registration.\n\nPlease note - you must complete this last step to become a registered member. You will only need to visit this url once to activate your account.\n\nTo activate your account, please visit this URL:'; $message .= 'http://www.phreakyourgeek.com/activate.php?id='.$memid.'&conf='.$confcode; mail($email,$subject,$message); header('Location: index.php?msg=true'); } First off, I don't know if I'm getting the member's ID correctly; normally I'd do $_SESSION['member_ID'], but this is the registration script so I haven't set the session yet. Furthermore, the e-mail comes as: Dear Rawr,\nThank you for registering at Ballistic Designs. Before we can activate your account one last step must be taken to complete your registration.\n\nPlease note - you must complete this last step to become a registered member. You will only need to visit this url once to activate your account.\n\nTo activate your account, please visit this URL:http://www.phreakyourgeek.com/activate.php?id=Resource id #4&conf=W4SCWJP4XDA7MCOP8SYJZZJ4HV89OVOAP7D In the case above, user "Rawr" has the ID 3 in the database, which means that I'm not getting the member ID correctly. Can anyone help? Quote Link to comment Share on other sites More sharing options...
koen Posted November 23, 2007 Share Posted November 23, 2007 A mysql query return a resource. You'll want to handle that resource with a function like $memid = mysql_result($query, 0) or something like it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.