Jump to content


This topic is now archived and is closed to further replies.


Need some help on this login Script...

Recommended Posts

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.... ;)

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
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;
                  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...

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.