I'm having this issue with the mail() function where I want to list the contents of a particular table row for row. Problem is that I can only get it to output either only 1 row, or send an email for each row.
Here's what I have (this way sends 1 message but only 1 row... 'cuz the mail() is outside the loop):
I'd like to display in the following format but my beginner's php skills don't cut it:PHP Code:$result = mysql_query("SELECT name, fee from db;");
while($row = mysql_fetch_array($result)) {
extract($row);
$comment="name: $name - fee: $$fee";
}
$subject = "Monthly Summary List";
$fromName = $yourname;
$fromAddres = $youremail;
$to = "me@domain.net";
mail($to, $subject, $comment, "From: ".$fromName." <".$fromAddress.">");
}
name: fred - fee: $9.00
name: joe - fee: $20.00
name: bill - fee: $3.00
Total: $32.00
thanks for the continuing support!




Bookmarks