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. Link to comment https://forums.phpfreaks.com/topic/23144-email-mysql-array-results/ 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 Link to comment https://forums.phpfreaks.com/topic/23144-email-mysql-array-results/#findComment-104824 Share on other sites More sharing options...
djones Posted October 6, 2006 Author Share Posted October 6, 2006 Yes that worked. Thanks. Link to comment https://forums.phpfreaks.com/topic/23144-email-mysql-array-results/#findComment-104967 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.