问题:任何一个回显都没有输出,尽管查询返回结果,也没有发送任何电子邮件。
代码:
<?php
$link = mysqli_connect('localhost','USER','PASSWORD','MY-DB');
$result = mysqli_query($link, "'SELECT * FROM Current WHERE Status = 'IE-Window-Missing' order by location desc" );
$headers = 'From: SCS@cl.com' . "\r\n" .
'Reply-To: SCS@cl.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if($result->num_rows >= 1){
$email = "d@cl.com";
$subject = "One or more devices have IE windows missing";
$message='The following devices are having issues: "';
while($row=$result->fetch_assoc()) {
$message.="{$row['Location']}\r\n";
}
$message.="has been accepted for review at redacted.";
if(mail($email, $subject, $message, $headers)) {
echo "Winning";
//mail successfully sent
} else {
echo "fail";
}
}
?>
对数据库进行直接 SQL 查询会产生结果……这里出了什么问题?
谢谢,