<?php

$sql = "select email, firstname, lastname from user_table order by
lastname"; 
$res = mysql_db_query(your_db, $sql);
if($res && mysql_num_rows($res))
{
   while($row=mysql_fetch_row($res))
   { 
          $email = $row[0];
          $firstname = $row[1];
          $lastname = $row[2];
      
          $message = "$firstname $lastname,\n\t <Your message
here>\n\nDatabase Administrator";
          $subject = "Your Subject here";
          
mail("$email","$subject","$message","FROM:[EMAIL PROTECTED]\nBCC:your
[EMAIL PROTECTED]");
     } 
} else { 
     $error = mysql_error();
     echo"your sql statement : $sql <BR> generated the following error :
$error"; 
}

?>


HTH 

-- 
****
Stephen Johnson 
[EMAIL PROTECTED] 
http://www.pets4u.com
Owner / Founder 
****
-- your next best friend is waiting for you -- 


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to