I wrote a stored procedure(MySQL) that should return all user's data by user's email. Here is my stored procedure:
-- Change Delimiter
DELIMITER //
-- Create Stored Procedure
CREATE DEFINER=`username`@`localhost` PROCEDURE GetUserByEmail(
IN Email VARCHAR(255)
)
BEGIN
SELECT * FROM user WHERE email = Email;
END//
-- Change Delimiter again
DELIMITER ;
However, instead of returning all data only for the user with specified email, it returns all user table. And when I run the same query without stored procedure it returns only data for the user with specified email. Here is the query:
SELECT * FROM user WHERE email = '[email protected]';