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: [email protected]' ; $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"; } } ?> 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']; 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 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 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
Archived
This topic is now archived and is closed to further replies.