djones Posted October 6, 2006 Share Posted October 6, 2006 How can I email the results of a MySQL array (loop). For example:[code]while ($myrow = mysql_fetch_array($result)){$field = $myrow["field"]; // Will return multiple rows}[/code]Now I need to mail the results above only once. I know how to use the mail function. Quote Link to comment Share on other sites More sharing options...
tomfmason Posted October 6, 2006 Share Posted October 6, 2006 You could do something like this.[code=php:0]$field = "begin list<br />";while ($myrow = mysql_fetch_array($result)){ $field .= $myrow['field'] . '<br />';.}$to = "someone";$subject = "something";$message = 'The is a list of someting: ' . $field;//now send the message[/code]Hope that helps,Tom Quote Link to comment Share on other sites More sharing options...
djones Posted October 6, 2006 Author Share Posted October 6, 2006 Yes that worked. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.