Reaper0167 Posted July 1, 2009 Share Posted July 1, 2009 The username does not appear. What is going on? This should be simple. <?php include "connection.php"; $user_in = $_POST['pin_find']; $user_email = $_POST['email_find']; $to = $user_email; $subject = 'Username Request'; $headers = 'From: me@mysite.com' ; $sql = "SELECT username FROM members WHERE secret_code = '$user_in' AND email = '$user_email' LIMIT 1"; $result = mysql_query($sql); $count=mysql_num_rows($result); $name = $result; $message = "Thank you for being a member. Your username is'" . $name . "' Please do not respond to this email."; if($count == 1) { if(mail($to, $subject, $message, $headers)) //if(mail($to, $subject, $message, "$headers")) { echo "Email sent"; } else { echo "Email not sent"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/164328-solved-cant-get-variable-to-work-seems-so-simple/ Share on other sites More sharing options...
vbnullchar Posted July 1, 2009 Share Posted July 1, 2009 s/b $name = $result['username']; Quote Link to comment https://forums.phpfreaks.com/topic/164328-solved-cant-get-variable-to-work-seems-so-simple/#findComment-866846 Share on other sites More sharing options...
Philip Posted July 1, 2009 Share Posted July 1, 2009 s/b $name = $result['username']; As well as calling mysql_fetch_assoc Quote Link to comment https://forums.phpfreaks.com/topic/164328-solved-cant-get-variable-to-work-seems-so-simple/#findComment-866848 Share on other sites More sharing options...
Reaper0167 Posted July 1, 2009 Author Share Posted July 1, 2009 thanks bud, i knew that, lol Quote Link to comment https://forums.phpfreaks.com/topic/164328-solved-cant-get-variable-to-work-seems-so-simple/#findComment-866851 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.