E-Mail an HTML table?
| From: | Gene Cronk | Date: | Mon, 26 Jun 2000 22:06:15 +0000 |
| Subject: | E-Mail an HTML table? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-3218@lists.php.net to get a copy of this message | ||
The following code creates a table from a database.....how would I put other
code in to mail this table to someone else?
<html>
<body>
<?php
$db=mysql_connect("host","user","passwd");
mysql_select_db("mydb",$db);
$result=mysql_query("SELECT * FROM $table ORDER BY name",$db);
if ($myrow=mysql_fetch_array($result)) {
echo "<table border=1>\n";
echo
"<tr><td>Name</td><td>RegHours</td><td>IncHours</td>
<td>IncRate</td><td>OTHours</td><td>VacHours</td>
<td>HolHours</td><td>TtlHours</td></tr>";
do {
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td>
<td>%s</td><td>%s</td><td>%s</td><td>%s</td>
</tr>\n", $myrow["name"], $myrow["reg_hours"],
$myrow["inc_hours"], $myrow["inc_rate"],
$myrow["ot_hours"], $myrow["vac_hours"],
$myrow["hol_hours"], $myrow["total_hours"]);
} while ($myrow=mysql_fetch_array($result));
echo "</table>\n";
} else {
echo "Sorry, no records found.";
}
?>
</body>
</html>
Gene Cronk
Asst. MIS
SACS Group - Jacksonville, FL
gene.cronk@sacsgroup.com
904-237-8793