On Mar 20, 6:32 pm, Michael Austin <maus...@firstdbasource.comwrote:
canaj...@gmail.com wrote:
I need to have a php script pull data from a mysql table and send it
in the body of an email
I know I can get the script to display information in the browser by
doing this:
$i=0;
while ($i < $num) {
$who=mysql_result($result,$i,"who");
$where=mysql_result($result,$i,"where");
echo "<b>$who</b><br>$where<hr><br>";
$i++;
}
and the output will look like:
john
toronto
If I use:
$message = "message text goes here";
I can get an email where the message reads "message text goes here"
how do I replace "message text goes here" with the information from
the mysql table
you are kidding right?
How about $message = $who."\n".$where;
unfortunately I'm not kidding, we have a form that sends to a
database, I tried to get to get it to send an email at the time the
form is submitted when a certain condition is met but no-one seems to
know how to do it, so the next best thing was to write a php script
and run a cron job with wget to search the database once a day looking
for entries that meet the criteria and send the email to the people
who need it
tried your suggestion, but it didn't work :( no email gets sent, but
it does give me some ideas
thanks