error(); $dberrno = $this->errno(); if($dberrno == 1114) { ?>
|
";
echo nl2br($errmsg);
if($GLOBALS['adminemail'])
{
$errlog = array();
if(@$fp = fopen(CYASK_ROOT.'./askdata/dberror.log', 'r'))
{
while((!feof($fp)) && count($errlog) < 20)
{
$log = explode("\t", fgets($fp, 50));
if($timestamp - $log[0] < 86400)
{
$errlog[$log[0]] = $log[1];
}
}
fclose($fp);
}
if(!in_array($dberrno, $errlog))
{
$errlog[$timestamp] = $dberrno;
@$fp = fopen(CYASK_ROOT.'./askdata/dberror.log', 'w');
@flock($fp, 2);
foreach(array_unique($errlog) as $dateline => $errno)
{
@fwrite($fp, "$dateline\t$errno");
}
@fclose($fp);
if(function_exists('errorlog'))
{
errorlog('MySQL', basename($GLOBALS['_SERVER']['PHP_SELF'])." : $dberror - ".cut_str($sql, 120), 0);
}
if($GLOBALS['dbreport'])
{
echo "
An error report has been dispatched to our administrator.";
@sendmail($GLOBALS['adminemail'], '[Cyask] MySQL Error Report',
"There seems to have been a problem with the database of your Cyask\n\n".
strip_tags($errmsg)."\n\n".
"Please check-up your MySQL server and forum scripts, similar errors will not be reported again in recent 24 hours\n".
"If you have troubles in solving this problem, please visit Cyask Community http://www.cyask.com.");
}
} else {
echo '
Similar error report has beed dispatched to administrator before.';
}
}
echo '