kee2ka4 Posted September 18, 2006 Share Posted September 18, 2006 Hello Everyone! I have a basic knowledge in php. I have got a Login Script where user can enter in their UserID (which is a numeric value) and a Password to login. I need a login system for my site however I need the user to enter in their email address and password. Therefore I edited the login Script changed all the variables and post values etc etc... However I keep getting the following error message::[quote]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 '@hotmail.com' at line 1"[/quote]Can anyone point me out in the right direction? Thanks for all the help.... ;) Quote Link to comment https://forums.phpfreaks.com/topic/21167-need-some-help-on-this-login-script/ Share on other sites More sharing options...
wildteen88 Posted September 18, 2006 Share Posted September 18, 2006 Could you post the code you use to perform your SQL Query here, aloing with the actuall query too. Not sure why you are getting that error. If you post your code, should be able to shed some light onto it. Quote Link to comment https://forums.phpfreaks.com/topic/21167-need-some-help-on-this-login-script/#findComment-94113 Share on other sites More sharing options...
kee2ka4 Posted September 18, 2006 Author Share Posted September 18, 2006 Hi! Thanks for your reply.. I did try to copy and paste the whole code but the page crashes... The sql query code in the login script is: [code]$query = "SELECT * FROM tbl_users WHERE cEmail = ".$email; //echo $query; mysql_pconnect($_SESSION['MYSQL_SERVER1'],$_SESSION['MYSQL_LOGIN1'],$_SESSION['MYSQL_PASS1']) or die("Unable to connect to SQL server"); mysql_select_db($_SESSION['MYSQL_DB1']) or die("Unable to select database"); $result = mysql_query($query) or die("Invalid query: " . mysql_error()); // if userid is not present in DB go back to login page... if (mysql_affected_rows() != 1) { echo "Error2!<br /> Please try again!<br />"; }[/code]Thanks for your help... Quote Link to comment https://forums.phpfreaks.com/topic/21167-need-some-help-on-this-login-script/#findComment-94134 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.