corillo181 Posted December 1, 2006 Share Posted December 1, 2006 how can i fix this 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 '@aim.com' at line 1 Link to comment https://forums.phpfreaks.com/topic/29059-searching-for-email/ Share on other sites More sharing options...
fert Posted December 1, 2006 Share Posted December 1, 2006 let's see your sql Link to comment https://forums.phpfreaks.com/topic/29059-searching-for-email/#findComment-133137 Share on other sites More sharing options...
corillo181 Posted December 1, 2006 Author Share Posted December 1, 2006 [code]<?phpinclude_once'../includes/db.php';include_once'../includes/header.php';$email=$_POST['email'];$email=stripslashes($email);$email=mysql_real_escape_string($email);if($email==""){echo "please enter your email";include'../htmlforms/lost_pw.html';}$checkemail=mysql_query("SELECT username,password FROM tra_users WHERE email=$email")or die(mysql_error());while($mail=mysql_fetch_array($checkemail)){$password=$mail['password'];$username=$mail['username'];if(!$checkmail){echo"that email is not a active email";include'../htmlforms/lost_pw.html';}else{$subject=" your lost password";$message=" hello this is your lost password from mysite.comusername=$usernamepassword=$passwordkeep your password in a safe place..This is an automated response, please do not reply!";mail($_POST['email'],$subject,$message);echo "your password has been sent";}}?>[/code] Link to comment https://forums.phpfreaks.com/topic/29059-searching-for-email/#findComment-133138 Share on other sites More sharing options...
fert Posted December 1, 2006 Share Posted December 1, 2006 try this[code]$checkemail=mysql_query("SELECT username,password FROM `tra_users` WHERE `email`='$email'")or die(mysql_error());[/code] Link to comment https://forums.phpfreaks.com/topic/29059-searching-for-email/#findComment-133139 Share on other sites More sharing options...
The Little Guy Posted December 1, 2006 Share Posted December 1, 2006 If fert's doesn't work try this:[CODE]$checkemail=mysql_query("SELECT * FROM `tra_users` WHERE `email`='$email'")or die(mysql_error());[/CODE] Link to comment https://forums.phpfreaks.com/topic/29059-searching-for-email/#findComment-133142 Share on other sites More sharing options...
corillo181 Posted December 1, 2006 Author Share Posted December 1, 2006 great!!!! i forgot i had to put '' so query can read the variable..thanx Link to comment https://forums.phpfreaks.com/topic/29059-searching-for-email/#findComment-133144 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.