title: Read related table fields from trigger in MySQL
body: <p>I have a table visitor with fields Id,Name,MObile,EMail</p>
  
  <p>&amp; a child table VisitorHistory with fields Id,VisitorId[ForeignKey with Visitor table], Date, Purpose</p>
  
  <p>I am writing a trigger against VisitorHistory , so that every new insert will logged to a different table
  SO i use the below trigger</p>
  
  <pre><code>CREATE TRIGGER Trigger_VisitHistory_INSERT
  AFTER INSERT
     ON VisitorHistory FOR EACH ROW
  BEGIN
      DECLARE visitor_id integer;
      DECLARE visitor_name varchar(255);
      DECLARE priority integer;
      DECLARE description varchar(550);
      DECLARE activity varchar(255);
      DECLARE actionId integer;
     set @visitor_id=new.VisitorId;
     set @visitor_name=''; Is any way to get visitor_name from the related table [foreign key table]
     set @priority=1;
     set @description= concat(' USer Visited again for ',new.Purpose);
     set @activity='Revisit';
     set @actionId=new.Id;
      INSERT INTO ActivityLog (UserId,Priority,Activity,Description,ActionId) VALUES (@user_id,@priority,@activity,@description,@actionId);
  END;
  </code></pre>
  
  <p>Is any way to get visitor_name from the related table  using VisitorID[foreign key table] so i can use that with description in log</p>