Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
Create procedure sp_validatelogin(IN email varchar(50), IN ppassword VARCHAR(50))
BEGIN
if exists(Select * From user_details
Where `email`=email
And
`password` = ppassword) THEN
SELECT 1;
else
select 0;
END;


My error is
-[Err] 1064 - 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 '' at line 10.


Please someone having some idea then tell me.

Thanks in advance.
Posted
Updated 21-Nov-11 19:26pm
v2

1 solution

Try this
SQL
Create procedure sp_validatelogin(IN email varchar(50), IN ppassword VARCHAR(50))
BEGIN
if (Select * From user_details Where `email`=email And `password` = ppassword) THEN
  SELECT 1;
else
  select 0;
END;
 
Share this answer
 
Comments
chinta123 22-Nov-11 5:38am    
[Err] 1064 - 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 '' at line 7..

it also showing this error..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900