对于每个想到了error_reporting()函数的人,事实并非如此,每当MySQL查询完成时,我所需要的就是
if($result)
{
echo "Yes,it was fine... bla bla";
}
else
{
echo "ObvIoUsly,the echo'ing will show in a white page with the text ONLY...";
}
每当语句是对还是错时,我都希望在使用header()函数重定向时出现错误,并在页面上某处的div中回显错误报告.
基本上是这样的:
$error = '';
这部分出现在div标签内
<div><?PHP echo $error; ?></div>
if($result)
{
$error = "Yes,it was fine... bla bla";
header("Location: url");
}
else
{
$error = "Something wrong happened...";
header("Location: url");
}
但这只是行不通的:(
最佳答案
原文链接:https://www.f2er.com/mysql/532080.html