here is my problem i have a data base and i have one table named request_recommend(requestid,status,for_email,sender_email,receiver_email) and one named connections(mail,connected_mail,type_of_con,comment,dateOfJoin)
and i want to create a trigger who does not allow to create request_recommendation tuple if the writer and the recommended is not connected
i really do not how to do this and i ll be great full if anyone can help
thnx in advance

i also try the following code
delimiter $$

create trigger mytrigg before insert on recommendation_request

for each row
begin

select email,connectedWith_email
from connects
where (email=new.sender_email and connectedWith_email=new.for_email)or(email=new.for_email and connectedWith_email=new.sender_email);

if(not found) then

call fail ('Not a valid state.(NO FIRST NETWORK CONNECTION)');

END IF;

end

but i take this error
line 3 Not allowed to return a result set from a trigger 1415

i work with query browser

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.