title: How to get values from different table and pass it to a trigger?
body: <p>i have 3 tables:</p>
  
  <pre><code>event:
  ---------------------
  event_id | uid | date
  ---------------------
  
  event_invitees
  ----------------------
  invitees_id | event_id
  ---------------------- 
  
  notification
  -----------------
  uid | invitees_id
  -----------------
  </code></pre>
  
  <p>i have created one trigger which will insert into 'notification' table after insert on 'event_invitees'</p>
  
  <pre><code>delimiter |
  create trigger eventNotificationTrigger after insert on event_invitees
  for each row 
  begin
  declare id int(12);
  set id = (select uid from event where event_id=new.event_id);
  insert into notification (invitees_id,uid) select invitees_id,@id from event_invitees where event_id=new.event_id;
  end;
  |
  </code></pre>
  
  <p>But it is not able to fetch uid from the event table. So how to fetch different values from different tables and insert them to one table in trigger?</p>