This topic is locked

Create MAIL header from emails in table

11/26/2008 9:26:51 AM
PHPRunner General questions
R
ringah author

I have a code snippet on List page:

global $conn;

$strSelect = "select Directory_EMail from _Directory where Directory_Project='".$data["DocIn_Project"]."' and Directory_PM=1";

$rst = db_query($strSelect,$conn);

while ($data2 = db_fetch_array($rst)) {

$pmemail =$data2["Directory_EMail"];

}


which I want to return the emails of all project managers from a staff directory table, however if there are more than one Project Managers listed it will only return the email address from the last record in the table. Needs to be constructed in the following format so I can use it as a cc Header in MAIL:
'pm1@mysite.com, pm2@mysite.com, pm3@mysite.com'
almost there...can anyone give me any pointers ?
Thanks in advance..