php - Swift Mailer sending only last row of table -
i pulling email addresses database table , iterating through them send email. if comment out line $mailer->send($message); email sent out, last row in table. if leave line in, email sent recipients, sends twice last row in table. doing wrong? <?php // pull data database $query = "select emailaddress, firstname, lastname test_table"; if ($result = mysqli_query($link, $query)) { /* put data array */ while($row = mysqli_fetch_assoc($result)) { $swimmers[] = $row; } /* free result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); /* create replacements array */ $replacements = array(); foreach ($swimmers $swimmmer) { $replacements[$swimmer["emailaddress"]] = array ( "{firstname}" => $swimmer["firstname"], "{lastname}" => $swimmer["lastname"],...