Re: [NEWBIE] Trying to combine array into one string

From: Date: Tue, 15 Feb 2005 17:58:22 +0000
Subject: Re: [NEWBIE] Trying to combine array into one string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-208748@lists.php.net to get a copy of this message
> 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 it works: $tantoQuery = "SELECT forum_members.emailAddress AS email FROM forum_members, event_tanto WHERE forum_members.ID_MEMBER = event_tanto.tanto AND event_tanto.event ='" . $show . "'"; $tantoResult = mysql_query($tantoQuery) or die('Query failed: ' . mysql_error()); while ($tantoData = mysql_fetch_array($tantoResult, MYSQL_ASSOC)) { $tantoEmail[] = $tantoData['email']; } if (count($tantoEmail) > 0) { mail(implode(',',$tantoEmail), $subject, $mailcontent, $addHeaders); } mysql_free_result($tantoResult);

« previous php.general (#208748) next »