/
Here is an example to select every distinct category
from the table lyrics, compile all of them into one variable
and then mail it.
/
$categories = ""; / good habit 🙂 */
$sql = "SELECT DISTINCT category from {$DB_CONF["lyrics"]} ";
$sql_result = mysql_query($sql) or die ("Couldn't execute query. (category()) ".mysql_error());
while ($row = mysql_fetch_array($sql_result))
{
$categories .= $row['category'];
}
$msg = "Here are a listing of categories:\n\n";
$msg .= $categories;
$email = "user@example.com";
$admin = "admin@example.com"; // reply-to, needed!!
$title = "Test Title";
$from = "From: LyricBot\nReply-to: $admin";
mail($email, $title, $msg, $from);
cheers,
kyle