title: looping a query from multiple variables?
body: <p>I'm rewriting my newsletter mailer to throttle sending to certain domains. basically subscribers are saved in <code>mailer_lists</code> in another form, then they get assigned the mailing ip to use with that mailing ip's limit for the specified domain. the code below is my attempt to gather that information.</p>
  
  <p>What I'm trying to do is pull records for query matches, looping through <code>$node_ip</code>, <code>$throttle_domain</code>, and <code>$throttle_speed</code> and then stop pulling records if it hits the global limit, then send. i'm having trouble getting it to work right..</p>
  
  <pre><code>function queue(){
  $query = "SELECT * FROM `mailer_lists` WHERE `ip` = '$node_ip' AND `email` LIKE '%".$throttle_domain."' LIMIT ".$throttle_speed."" ;
  $result = mysql_query($query) or die(mysql_error());
  $num_rows = mysql_num_rows($result);
  $count = $num_rows;
  }
  if ($count &lt; $global){
  queue();
  }else{
  mail();
  </code></pre>
  
  <p><BR>
  Wish I had 1/2 the skills some of you have. Looking forward to any ideas..</p>