title: Query DB to get multiple rows where timestamps are the same, and email addresses are the same
body: <pre><code>&lt;?php
  $curr = time();
  
  $time_query = "SELECT * FROM users ";
  
  $time_query_result = mysql_query($time_query, $db) or 
  
  die("Could not execute sql: $time_query"); 
  
  $num_result = mysql_num_rows($time_query_result);
  
  for ($i1=0; $i1 &lt; $num_result; $i1++){
  
      $row = mysql_fetch_array($time_query_result); 
  
  
      if ($curr &gt; $row["time"] + 259200)//Do if it has been three days since brochure was selected
      {
             $arr = implode (',', $row);//TURN THE ROW[BROCHURES] ARRAY INTO IMPLODE THING INSIDE THIS LOOP!?!?!
          echo $arr;
          $message1  = '&lt;html&gt;&lt;body&gt;&lt;p&gt;Brochure reminder&lt;/p&gt;';
          $message1 .= 'Brochures:&lt;br /&gt;'.$arr .$row["brochures"]. $row["time"];
          $message1 .= '&lt;/body&gt;&lt;/html&gt;';
          // Mail it
          mail($row['email'], $subject, $message1, $headers);
      }
  
  } ?&gt;
  </code></pre>
  
  <p>So basically, I want to send an email to customers selecting a brochure. That part is done and fine, but I want them to receive another email after three days reminding them about the brochures they have chosen. I have set up a cron job so this piece of code gets repeated every three days.</p>
  
  <p>When the mail is sent, it sends it to the correct person but the selected brochures are split into seperate emails. For example, if somebody selects 5 brochures, after three days they will reveice 5 seperate emails, with a different brochure in each one. </p>
  
  <p>I need it so they receive all brochures in one email after three days. Would really appreciate this, been driving me mad for days. It seems like the answer could be really simple but I cant figure it out.</p>
  
  <p>Thanks!</p>