Jump to content

Getting string from looped array


Drummin

Recommended Posts

Hello,

I'm going to be sending emails to users from a community calendar showing events for the day or a time frame specified elsewhere.  The problem I'm having is turning results of DB query into a string when there are multiple results for the day.  It works just fine with single results.  I understand why it doesn't work but can't figure out how to solve the problem.  Don't worry about the $eventdate as that comes from the same array as the $event_id used to call the array shown below.  I tried foreach and implode but couldn't get it working so I'm starting over and asking for your guidance on how is the best way to pull this off.  Thanks for your help.

 

 

$getevent = mysql_query("SELECT title, description from ".$conf['tbl']['events']." WHERE event_id=$event_id AND private=0");
WHILE ($gtevent = mysql_fetch_array($getevent)) {
$event_title=$gtevent['title'];
$event_description=$gtevent['description'];

$message="<p><span style=\"font-size:24px\">$event_title</span><br />$eventdate</p><p>$event_description</p>";

} 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.