我意识到or die("message")
会打印邮件并退出,但如何回复邮件并退出?
$resolveGet = mysql_query($sqlGet) or exit("<span style='padding-left:10px;'>No results matching search term provided.</span>");
答案 0 :(得分:1)
您的特定代码也可以采用不同的方式编写,因为您拥有的代码是逻辑或:
$resolveGet = mysql_query($sqlGet);
if (!$resolveGet ) {
// exit("<span style='padding-left:10px;'>No results matching search term provided.</span>");
// can rewrite this as
echo "<span style='padding-left:10px;'>No results matching search term provided.</span>";
die(); // or exit; // whatever
}