PHP General,
The Situation:
I'm retrieving some email addresses from a database. I want to be
able assemble all the addresses into one string that I can use in the
mail() command. At no time should there ever be more than about 5 email
addresses collected from the database. I want all
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 15, 2005 7:37 AM
To: php-general
Subject: [PHP] [NEWBIE] Trying to combine array into one string
PHP General,
The Situation:
I'm retrieving some email addresses from a database. I want to be
able assemble all the addresses
The Problem:
I can't quite figure out how to take the results of the
mysql_query() and assemble them into a string. In my experiments so far,
I either get a mysql_data_seek(): Offset 0 is invalid for MySQL result
index error, or my mail function sends to a blank address.
no guarantee
Use implode:
http://nl2.php.net/manual/en/function.implode.php
On 15 Feb 2005, at 16:37, Dave wrote:
PHP General,
The Situation:
I'm retrieving some email addresses from a database. I want to be
able assemble all the addresses into one string that I can use in the
mail() command. At no
Dave mailto:[EMAIL PROTECTED]
on Tuesday, February 15, 2005 7:37 AM said:
The Problem:
I can't quite figure out how to take the results of the
mysql_query() and assemble them into a string. In my experiments so
far, I either get a mysql_data_seek(): Offset 0 is invalid for MySQL
Hello Dave,
Tuesday, February 15, 2005, 8:37:02 AM, you wrote:
D while ($tantoData = mysql_fetch_array($tantoResult))
D {
D $tantoEmail = $tantoEmail . , . $tantoData;
D }
D mail($tantoEmail, $subject, $mailcontent, $addHeaders);
Everything looked good up to here.
Dave wrote:
PHP General,
The Situation:
I'm retrieving some email addresses from a database. I want to be
able assemble all the addresses into one string that I can use in the
mail() command. At no time should there ever be more than about 5 email
addresses collected from the database. I
Dave wrote:
The Situation:
I'm retrieving some email addresses from a database. I want to be
able assemble all the addresses into one string that I can use in the
mail() command. At no time should there ever be more than about 5 email
addresses collected from the database. I want all
Matt, Warren, Gareth, Chris, Jochem, Ospinto, Richard,
Thank you all for your helpful suggestions. implode() is the command
I needed, and I've applied syntax similar to Matt's suggestion.
My problem is now solved.
Your responses are all much appreciated.
--
Dave Gutteridge
[EMAIL
9 matches
Mail list logo