RE: Needing help hear

From: Date: Tue, 15 May 2001 09:47:29 +0000
Subject: RE: Needing help hear
Groups: php.general 
Request: Send a blank email to php-general+get-52825@lists.php.net to get a copy of this message
I think you want $recipient .= $myrow["email"] . ","; although that does leave a comma at the end. You can just knock the last character off the end or , more elegantly, $recipient = array(); while ($myrow = mysql_fetch_array($result)) $recipient[] = $myrow["email"]; $recipient_list = implode(",", $recipient); Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -----Original Message----- > From: Richard Kurth [mailto:rkurth@pacifier.com] > Sent: 15 May 2001 09:16 > To: php-general@lists.php.net > Subject: Needing help hear > > > > I am trying to pull all the e-mail out of the database and put them > in a format like this me@domain.com,me2@domain.com,me3@domain.com > this is what I have now but I don't seam to be going in the right > direction. Could somebody give me a hint > > $sql = "SELECT email FROM customers"; > $result = mysql_query($sql); > $num_rows = mysql_num_rows($result); > > while ($myrow = mysql_fetch_array($result)){ > > $recipient=$myrow["email"] . ","; > } > > > > > > > > > > > > > > > > > Best regards, > Richard > mailto:rkurth@pacifier.com > >

« previous php.general (#52825) next »