Hi, I am trying to get the results of an SQL SELECT query, executed in a PHP file, emailed to me. I know how to do the email part but how do I get the select results into a variable that can be used in the email. If there was only ever one result I know how to do it but if there are multiple results I am stuck. So far I have the following, appreciate any help.
Query
$sql = "SELECT * FROM enhance WHERE time BETWEEN 1 AND $time";
$result = mysql_query("$sql",$db);
What goes in here?
Email
$to = "myemailaddress";
$subject = "whatever ...";
$message = "$selectresults";
$header = "From: whoever\n";
mail($to, $subject, $message, $header);