Re: [PHP] Getting email out of a database

2001-05-19 Thread Christian Dechery

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";
> $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
>[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]
>
>  But 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=  [EMAIL PROTECTED]
> $v2=  [EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]
>
> How would I go about this
>
>
>
>Best regards,
>  Richard
>mailto:[EMAIL PROTECTED]
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Getting email out of a database

2001-05-19 Thread Richard Kurth


  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";
$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
[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]

 But 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=  [EMAIL PROTECTED]
$v2=  [EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]

How would I go about this



Best regards,
 Richard  
mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]