PHP/MySQL Question? How do I pull a record from a MySQL database and email the...

michaelnaeseth

New member
...results via PHP? How do I pull a record from a MySQL database and email the results via PHP?

PLEASE READ!!
To be clear, I know how to send an email and pull a record from a mysql database using PHP.

What I am asking here is once I have my MySQL query results, what are the steps needed to mail these database results?

Here is my current query.php file:

<?php

mysql_connect("localhost","username","password");
mysql_select_db("database1");

$query = mysql_query("select pre_id, id, pre_name, firstname, lastname, pre_address, projectaddress, pre_zip, zipcode, pre_ph, bestphone, pre_email, emailaddress, pre_systype, typeofsystem, pre_time, projecttimeline, post_time from formatteduserrecords where id='$lead_id'");


echo "Customer Lead<br /><br />";

while ($row = mysql_fetch_assoc($query)) {
echo $row['pre_id'];
echo $row['id'];
echo $row['pre_name'];
echo $row['firstname'];
echo $row['lastname'];
echo $row['pre_address'];
echo $row['projectaddress'];
echo $row['pre_zip'];
echo $row['zipcode'];
echo $row['pre_ph'];
echo $row['bestphone'];
echo $row['pre_email'];
echo $row['emailaddress'];
echo $row['pre_systype'];
echo $row['typeofsystem'];
echo $row['pre_time'];
echo $row['projecttimeline'];
echo $row['post_time'];

}


mysql_free_result($result);
?>

What do i need to add to the code above to get it to email the form results?
 
Back
Top