Re: Getting email out of a database
| From: | Christian Dechery | Date: | Sat, 19 May 2001 18:35:51 +0000 |
| Subject: | Re: Getting email out of a database | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-53538@lists.php.net to get a copy of this message | ||
how about grabbing the first result out of the 'while'??? something like:
list($var1) = mysql_fetch_row($result);
while( list($email) = mysql_fetch_row($result) )
$var2[] = $email;hope this helps... At 11:04 19/5/2001 -0700, Richard Kurth wrote:
I am trying to pull all the e-mail address out of a database to be able to do a mass send. This gets me all the e-mail address and puts a , between them which is what I want. $sql = "SELECT CONCAT(email) AS str_email FROM customers";____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer$result = mysql_query($sql); $recip = array(); while ($myrow = mysql_fetch_array($result)) $recip[] = $myrow["str_email"]; $recipient_list = implode(", ",$recip);I t gives me this list which is what I wanted test1@domain.com,test2@domain.com,test3@domain.com,test4@domain.comBut now I would like to get the first address in the list into a variable and the rest in the list to a second variable Like this $v1= test1@domain.com $v2= test2@domain.com,test3@domain.com,test4@domain.comHow would I go about thisBest regards, Richard mailto:rkurth@pacifier.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net