title: php mail with variables
body: <p>I am attempting to setup a mail script which will first run a simple select from mysql, and use these array variables in the message. However all the variables are not output to the message body, only one row of variables. Here is my script:</p>
  
  <pre><code>    $sql1 = "SELECT * FROM videos WHERE checked_out = '1'"; 
      $result1 = $dbLink-&gt;query($sql1); 
                while($row1 = $result1-&gt;fetch_assoc()) {
      $name = $row1['name'];
      $tape_no = $row1['tape_no'];
      $member_name = $row1['member_name'];
      $date_out = date("F j, Y", strtotime($row1['date_out']));
                }
  
  //email function to administrator
  $to = "nouser@mail.com";
  $subject = "Daily Video Rental Summary";
  $message = "$name $tape_no $date_out $member_name
  ======================================================================
  PLEASE DO NOT REPLY TO THIS MESSAGE, AS THIS MAILBOX IS NOT MONITORED
  ======================================================================";
  $from = "no_replies_please@mail.com";
  $headers = "From:" . $from;
  mail($to,$subject,$message,$headers);
  </code></pre>
  
  <p>appreciate any insight anyone cares to share on this. 
  Thanks, 
  --Matt</p>