Greetings,
Starting off Highlevel: I am trying to perform a query of my database and email the person who filled out the form the results. I am able to setup the form submission, perform the query and echo all of the results out to the screen using while and the mysql_fetch_array. I can add the email code to send the information after each result. However, I want the user to only receive one email.
How do I send all of the results in one email?
Thanks,
Akbbell
Get the Data from a while mysql_fetch_array
Moderator: General Moderators
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: Get the Data from a while mysql_fetch_array
Loop through the results concatenating the results onto the end of the email body, then sending the email using the constructed body afterwards? I don't really know what you're saying, you need to be talking lower level! 
Re: Get the Data from a while mysql_fetch_array
That works exactly the way I needed. I was thinking I needed to do some sort of for loop to get all of the data. All I needed to do was put the data in a concatenated string.
$var ='';
while($row = mysql_fetch_array($query)){
$var .= "Message: $row[data];
}
I can send my email with $var data which is now text of all of the results.
Thanks,
$var ='';
while($row = mysql_fetch_array($query)){
$var .= "Message: $row[data];
}
I can send my email with $var data which is now text of all of the results.
Thanks,