Mysql stored procedure where clause
Ok, let me try this again.
query ("CALL getemployee ('$ eml')"); $ result = $ sql-> fetch_array (); ? > This is my stored procedure:
Delimiter //
Create procedure getemployee(in eml varchar(50))
Begin
Select * from employees where email = eml;
End//
Delimiter ;
The error I get from the browser is: "Fatal error: calling the fetch_array () member function for a non-object ...".
I am using phpmyadmin version 3.2.4 and mysql client version: 5.1.41
Your operator CREATE PROCEDUREappears to be invalid.
You need to specify the name of your procedure and the parameter that you pass. So you can try something like the following example:
DELIMITER //
CREATE PROCEDURE procName (IN eml varchar(50))
BEGIN
SELECT * FROM employees WHERE email = eml;
END//
DELIMITER ;