0
Make a stored function to search for a user given the user's username & password. Arguments to the function: username & password
the function must return true if it exists false if it doesn't. Tried a couple of things but I'm still getting some errors using MySQL.
2 Respostas
+ 1
Hi can i see some of the code to be able to help out please.
0
Thanks for taking your time to look into this by the way :)
delimiter $
create function cred(u varchar(15), p varchar(6))
returns char(5) DETERMINISTIC
begin
declare a CHAR(5);
if (select username = u and pwd = p from customers) then set a = 'true';
else set a = 'false';
end if;
end$
delimiter ;
select cred('dJete', 'abc112');