title: How to get multi email from one form?
body: <p>I created a registration form with multi participant name registering in one form.</p>
  <p>It successfully inserts the participant's details to database and send to admin's email.</p>
  <p>My issue is I am only receiving one participants' detail in email.</p>
  <p>Sample: If I register 3 participants I am only getting the third participant's details in the email.</p>
  <p>I am not getting 1st and 2nd participant details.</p>
  <p>How to solve this issue. Thanks in advance.</p>
  <p>[Please find the image below on multi participants form][1]
  [1]: https://i.stack.imgur.com/OJrTf.png</p>
  <pre><code>        $sql = &quot;
      INSERT INTO testing (name , designation, company_name, mobile, nature_business, person_incharge, person_email, person_mobile, address, tel, hrdf, sme, coursename, price, date, month, year) 
          
          VALUES 
          
          (
          '&quot;.$name.&quot;' 
  
          ,'&quot;.$_POST['date'].&quot;'
          ,'&quot;.$_POST['month'].&quot;'
          ,'&quot;.$_POST['year'].&quot;'        
          )&quot;;
          
          $mysqli-&gt;query($sql);
      }
  }
  
  
      
  
  
  
  
      $mail-&gt;setFrom($_POST['email'],$_POST['name']);
      $mail-&gt;addaddress(');
      $mail-&gt;addReplyTo($_POST['email'],$_POST['name']);
      
      $mail-&gt;isHTML(true);
      $mail-&gt;Subject=''.$_POST['subject'];
      $mail-&gt;Body=
  '&lt;h3&gt;
      &lt;b&gt;Applying for Public Training Course
  &lt;/h3&gt;   
      &lt;br&gt;&lt;br&gt;
      &lt;p&gt;
      &lt;b&gt;Participant Name:&lt;/b&gt;&lt;/br&gt; '.$name.'
      &lt;br&gt;
      &lt;b&gt;Date:&lt;/b&gt;&lt;/br&gt; '.$_POST['date'].' (Date), '.$_POST['month'].' (Month), '.$_POST['year'].' (Year)
  &lt;/p&gt;';
      if(!$mail-&gt;send()){
      echo &quot;Message could not sent!&quot;;
      }
      else{
      echo&quot;&lt;script&gt;
          alert('We received your message! We will reply to your message as soon as possible.'); 
          window.history.go(-1);
       &lt;/script&gt;&quot;;
      }
  }
  </code></pre>
  <p>Below is my form</p>
  <pre><code>&lt;form action=&quot;addmore.php&quot; method=&quot;post&quot;&gt;
  
  &lt;div class=&quot;row&quot;&gt; 
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;p&gt;Participant/s Details&lt;/p&gt;
      &lt;label class=&quot;small&quot;&gt;* You may add more participants by clicking &quot;Add More&quot; button&lt;/label&gt;
      &lt;/div&gt; 
      
      &lt;table class=&quot;tablecustom&quot; id=&quot;dynamic_field&quot;&gt; 
      &lt;div class=&quot;col-sm-8&quot;&gt; 
          &lt;input type=&quot;text&quot; name=&quot;name[]&quot; placeholder=&quot;Enter Name&quot; class=&quot;form-control name_list&quot; required/&gt;  
  
          &lt;input type=&quot;text&quot; name=&quot;designation[]&quot; placeholder=&quot;Enter Designation&quot; class=&quot;form-control name_list&quot; required /&gt;    
                          
          &lt;input type=&quot;number&quot; name=&quot;mobile[]&quot; placeholder=&quot;Enter Mobile&quot; class=&quot;form-control name_list&quot; required /&gt; 
                          
          &lt;button type=&quot;button&quot; name=&quot;add&quot; id=&quot;add&quot; class=&quot;btn btn-success&quot;&gt;Add More&lt;/button&gt; 
      &lt;/div&gt;
      &lt;/table&gt;      
  &lt;/div&gt;
  
                  
  
  &lt;div class=&quot;row&quot;&gt; 
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;p&gt;Company Name&lt;/p&gt;
      &lt;/div&gt; 
      
      &lt;div class=&quot;col-sm-8&quot;&gt; 
      &lt;input type=&quot;text&quot; name=&quot;company&quot; placeholder=&quot;Enter Company Name&quot; class=&quot;form-control name_list&quot; required/&gt;&lt;/td&gt; 
      &lt;/div&gt;
  
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;p&gt;Company Address&lt;/p&gt;
      &lt;/div&gt; 
      
      &lt;div class=&quot;col-sm-8&quot;&gt;             
      &lt;input type=&quot;text&quot; name=&quot;address&quot; placeholder=&quot;Enter Company Address&quot; class=&quot;form-control name_list&quot; required/&gt;
      &lt;/div&gt;      
  
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;p&gt;Company Tel No&lt;/p&gt;
      &lt;/div&gt; 
      
      &lt;div class=&quot;col-sm-8&quot;&gt;             
      &lt;input type=&quot;text&quot; name=&quot;tel&quot; placeholder=&quot;EG: 0312345678&quot; class=&quot;form-control name_list&quot; required/&gt;
      &lt;/div&gt;      
  
  
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;p&gt;Nature of Business&lt;/p&gt;
      &lt;/div&gt; 
      
      &lt;div class=&quot;col-sm-8&quot;&gt;             
      &lt;input type=&quot;text&quot; name=&quot;nature&quot; placeholder=&quot;Enter Nature of Business&quot; class=&quot;form-control name_list&quot; required/&gt;
      &lt;/div&gt;  
  
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;p&gt;Contact Person&lt;/p&gt;
      &lt;/div&gt; 
      
      &lt;div class=&quot;col-sm-8&quot;&gt;             
      &lt;input type=&quot;text&quot; name=&quot;person&quot; placeholder=&quot;Enter Person in Charge&quot; class=&quot;form-control name_list&quot; required/&gt;
      &lt;/div&gt; 
      
      
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;p&gt;Contact Person's Email&lt;/p&gt;
      &lt;/div&gt; 
      
      &lt;div class=&quot;col-sm-8&quot;&gt;             
      &lt;input type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Enter Person in Email&quot; class=&quot;form-control name_list&quot; required/&gt;
      &lt;/div&gt;
      
      
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;p&gt;Contact Person's Mobile&lt;/p&gt;
      &lt;/div&gt; 
      
      &lt;div class=&quot;col-sm-8&quot;&gt;             
      &lt;input type=&quot;number&quot; name=&quot;personmobile&quot; placeholder=&quot;Enter Person Mobile Number&quot; class=&quot;form-control name_list&quot; required/&gt;
      &lt;/div&gt;     
  
  
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;p&gt;HRDF Registered Company&lt;/p&gt;
      &lt;/div&gt; 
      
      &lt;div class=&quot;col-sm-8&quot;&gt;  
      
      &lt;input type=&quot;radio&quot; id=&quot;male&quot; name=&quot;hrdf&quot; value=&quot;Yes&quot; required&gt;
      &lt;label for=&quot;male&quot;&gt;Yes&lt;/label&gt;    
      
      &lt;input type=&quot;radio&quot; id=&quot;female&quot; name=&quot;hrdf&quot; value=&quot;No&quot;&gt;
      &lt;label for=&quot;female&quot;&gt;No&lt;/label&gt; 
      &lt;/div&gt;   
      
      
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;p&gt;SME Company&lt;/p&gt;
      &lt;/div&gt; 
      
      &lt;div class=&quot;col-sm-8&quot;&gt;             
      &lt;input type=&quot;radio&quot; id=&quot;male&quot; name=&quot;sme&quot; value=&quot;Yes&quot; required&gt;
      &lt;label for=&quot;male&quot;&gt;Yes&lt;/label&gt;    
      
      &lt;input type=&quot;radio&quot; id=&quot;female&quot; name=&quot;sme&quot; value=&quot;No&quot;&gt;
      &lt;label for=&quot;female&quot;&gt;No&lt;/label&gt; 
      &lt;/div&gt;       
  
  
      &lt;div class=&quot;col-sm-4&quot;&gt;             
      &lt;/div&gt; 
  
  &lt;?php
      $sql = mysql_query(&quot;SELECT * FROM sys_course WHERE sys_course_id = '$id'&quot;);
      if(mysql_num_rows($sql) &gt; 0) {
      while($row = mysql_fetch_array($sql)) {
  ?&gt; 
      &lt;input type=&quot;hidden&quot; class=&quot;form&quot; name=&quot;coursename&quot; value=&quot;&lt;?php echo $row['sys_course_topic']; ?&gt;&quot;/&gt;
      &lt;input type=&quot;hidden&quot; class=&quot;form&quot; name=&quot;price&quot; value=&quot;&lt;?php echo $row['sys_course_price']; ?&gt;&quot;/&gt;
      &lt;input type=&quot;hidden&quot; class=&quot;form&quot; name=&quot;date&quot; value=&quot;&lt;?php echo $row['sys_course_date']; ?&gt;&quot;/&gt;
      &lt;input type=&quot;hidden&quot; class=&quot;form&quot; name=&quot;month&quot; value=&quot;&lt;?php echo $row['sys_course_month']; ?&gt;&quot;/&gt;
      &lt;input type=&quot;hidden&quot; class=&quot;form&quot; name=&quot;year&quot; value=&quot;&lt;?php echo $row['sys_course_year']; ?&gt;&quot;/&gt;
  &lt;?php } } ?&gt;
  
  
      &lt;div class=&quot;col-sm-8&quot;&gt;  
      &lt;div class=&quot;g-recaptcha&quot; data-sitekey=&quot;6LehlekZAAAAAATkbl5lKz156LPq_2b5MjGVVrp1&quot;&gt;&lt;/div&gt;&lt;br&gt;
      &lt;input type=&quot;submit&quot; name=&quot;submit&quot; id=&quot;submit&quot; class=&quot;btn btn-info&quot; value=&quot;Submit&quot; /&gt;  
      &lt;/div&gt;
  &lt;/div&gt;           
  
  &lt;/form&gt;
  </code></pre>