Jump to content

Need some help on this login Script...


kee2ka4

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.... ;)
Link to comment
https://forums.phpfreaks.com/topic/21167-need-some-help-on-this-login-script/
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;
  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...

Archived

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

×
×
  • Create New...

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.