$subject = "Subject";
require_once('db.php');
function get_s()
{
global $link;
$link->set_charset("utf8");
$p1 = 'xxx';
$sql = "SELECT * FROM current WHERE par= '$p1' ORDER BY id";
$result = mysqli_query($link, $sql);
$ps = mysqli_fetch_all($result, MYSQLI_ASSOC);
return $ps;
}
$message = '<table>
<thead>
the <tr>
<th scope="col">col1</th>
<th scope="col">col2</th>
<th scope="col">col3</th>
<th scope="col">col4</th>
</tr>
</thead>
<tbody>
the <tr>
<th></th>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>';
$headers= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
mail($to, $subject, $message, $headers);
// $data = get_s();
//
<tbody>
the <tr>
<td>' . $data['key'] . '</td>
there are other fields
</tbody>
Find more questions by tags PHP
I tried to do the same, but yet don't understand how to do the loop in this case.
- Colt2 commented on April 19th 20 at 12:29
.= this adds to a variable - laura.Price23 commented on April 19th 20 at 12:32