/    Sign up×
Community /Pin to ProfileBookmark

PHP email script that includes a MySql table

I have an script which sends an email notification when a MySql table is updated through a form. What I would like to do is include the contents of this table in the email that gets sent out, but I’m not sure how I would do that. Any help would be greatly appreciated! Thanks!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@MatMelJul 25.2007 — You can output the mysql table into the email just like a normal html-page:
[code=php]
$mail_body = "<table>";
$res = mysql_query("SELECT * FROM table");
while($res2 = mysql_fetch_array($res) )
{
$mail_body .= "<tr>";
foreach($res2 as $value)
{
$mail_body .= "<td> $value </tr>";
}
$mail_body .= "</tr>";
}
$mail_body .= "</table>";
[/code]
Copy linkTweet thisAlerts:
@ecbizJul 29.2007 — Good example... Where can I find the entire php script to do email notification on a per-conversation basis?

http://www.hdtvprices.co.uk
×

Success!

Help @ivdezine spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...