带有值表数据库的php邮件

时间:2017-02-14 19:24:02

标签: php mysql email

我在这段代码上有错误。我不能像我想要的那样得到数据库的结果

<?php


    $conn = mysqli_connect('localhost', '****', '****', 'kj1irpfd_bkintra');
    $sql="SELECT * FROM `picagem`";
    $query=mysqli_query($conn, $sql);

    $to      = "ricardo.ribeiro@bluekids.pt";
    $subject = "order information!";
    $message = 'thanks :) this is bank account
<table>
  <tr>
    <th>Numero</th>
    <th>datelogin</th>
    <th>datelogout</th>
    <th>horario</th>
  </tr>';
while($arraybank=mysqli_fetch_array($conn, $query)){
$message .='
<tr>
<td>'.$arraybank['numOper'].'</td>
<td>'.$arraybank['datelogin'].'</td>
<td>'.$arraybank['datelogout'] .'</td>
<td>'.$arraybank['horario'] .'</td> 
</tr>';
}

$message .= 'id order :'.$numOper.',shop again! ';

    $headers =  'MIME-Version: 1.0' . "\r\n".
                'Content-Type: text/html; charset=ISO-8859-1' . "\r\n".
                'From: shoesshe <cs@shoesshe.com>' . "\r\n" .
                'Reply-To: shoesshe <cs@shoesshe.com>' . "\r\n" .
                'X-Mailer: PHP/' . phpversion();

    mail($to, $subject, $message, $headers);

enter image description here

我该怎么办?怎么了?

我在这里结果,我的数据库有结果而不在这里显示。为什么呢?!

0 个答案:

没有答案