> >I need to query a database and return a resultset. A php script will then >sort through the data and send the data to the browser in the form of a table. > >Is it possible to gather the the results with html tags and store them in a >variable so that the results can be emailed to someone? If so, how would >this be done?
Do as much of the sorting/searching in SQL as you can. MUCH faster. Use the mail class from http://phpclasses.org to do the html-enhanced email. WARNING: Many readers will simply *TRASH* your "enhanced" email. Re-think your priorities. Collecting your HTML in a variable is easy: <?php $html = ''; # Get db stuff $html .= "<TABLE>\n"; # Loop through results{ $html .= "<TR><TD>$x</TD><TD>$y</TD><TD>$z</TD></TR>\n"; } $html .= "</TABLE>\n"; ?> It's just like doing everything with "echo", only not. :-) You may want to echo some stuff out as well, so you know what's happening... -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php