Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-05-2007, 10:23 AM   PM User | #1
alex57
Regular Coder

 
Join Date: Sep 2006
Posts: 216
Thanks: 9
Thanked 0 Times in 0 Posts
alex57 has a little shameless behaviour in the past
php and email

PHP Code:
mysql_connect("mysql10.powweb.com""""") or die(mysql_error());
mysql_select_db("info") or die(mysql_error());

$result2 mysql_query("SELECT team.TeamName, team.TeamID, League.LeagueID, League.Totalpts, SUM(selectedfootballerscore.TeamWeeklyScore), users.username FROM team, League, users, selectedfootballerscore WHERE (League.TeamID = team.TeamID) AND (selectedfootballerscore.TeamID = team.TeamID) AND (users.UserID = team.UserID) AND (League.LeagueID = '$LID') GROUP BY Totalpts");

echo 
"<table border=1><tr><td><font size=1 face='Verdana'>Team Name</font></td><td><font size=1 face='Verdana'>Manager</font></td><td><font size=1 face='Verdana'>Weekly Pts</font></td><td><font size=1 face='Verdana'>Total Pts</font></td><td></td></tr>";

while (
$row2 mysql_fetch_array($result2))
{
$messagept2 =  "<tr><td><font size=1 face='Verdana'>" $row2['TeamName'] . "</font></td><td><font size=1 face='Verdana'>" $row2['username'] . "</font></td><td><font size=1 face='Verdana'>" $row2['SUM(selectedfootballerscore.TeamWeeklyScore)'] . "</font></td><td><font size=1 face='Verdana'>" $row2['Totalpts'] . "</font></td></tr>";
}
echo 
"</table>"
I have the code above where data is being read out of a database and put into an html table. I want to ultimately send the data in the table as html in and email. How can this be done? Below is what I currently have. I can sned html using an extra header, but this wnt allow php to be sent.

thanks

PHP Code:
$subject $_POST['subject'];
$message "hello there, this is an email";
$to "alextrebsy57@hotmail.com";
$mailsend mail($to,$subject,$message); 
alex57 is offline   Reply With Quote
Old 03-05-2007, 12:19 PM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,604
Thanks: 2
Thanked 399 Times in 392 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Quote:
Originally Posted by alex57 View Post
PHP Code:
mysql_connect("mysql10.powweb.com""""") or die(mysql_error());
mysql_select_db("info") or die(mysql_error());

$result2 mysql_query("SELECT team.TeamName, team.TeamID, League.LeagueID, League.Totalpts, SUM(selectedfootballerscore.TeamWeeklyScore), users.username FROM team, League, users, selectedfootballerscore WHERE (League.TeamID = team.TeamID) AND (selectedfootballerscore.TeamID = team.TeamID) AND (users.UserID = team.UserID) AND (League.LeagueID = '$LID') GROUP BY Totalpts");

$data "<table border=1><tr><td><font size=1 face='Verdana'>Team Name</font></td><td><font size=1 face='Verdana'>Manager</font></td><td><font size=1 face='Verdana'>Weekly Pts</font></td><td><font size=1 face='Verdana'>Total Pts</font></td><td></td></tr>";

while (
$row2 mysql_fetch_array($result2))
{
$data .=  "<tr><td><font size=1 face='Verdana'>" $row2['TeamName'] . "</font></td><td><font size=1 face='Verdana'>" $row2['username'] . "</font></td><td><font size=1 face='Verdana'>" $row2['SUM(selectedfootballerscore.TeamWeeklyScore)'] . "</font></td><td><font size=1 face='Verdana'>" $row2['Totalpts'] . "</font></td></tr>";
}
$data .= "</table>"
PHP Code:
$subject $_POST['subject'];
$message "hello there, this is an email" $data;
$to "alextrebsy57@hotmail.com";
$mailsend mail($to,$subject,$message); 
Something like that ^
Inigoesdr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:17 PM.


Advertisement
Log in to turn off these ads.