有人可以解释为什么在设置新网站时会出现此错误吗?以及如何解决
警告:mysql_real_escape_string() [function.mysql-real-escape-string]:无法在第 8 行的 /home/sitename/public_html/cms/cms/admin/report.php 中建立到服务器的链接
现在第 8 行的内容:
$report = mysql_real_escape_string( $report );
编辑
<?php
require_once('auth.php'); require('core/plugin.php');
// session details are here
require('core/connection.php');
if($session_id == $session_id){
$report = $_POST['reportmsg'];
$report = strip_tags( $report );
$report = mysql_real_escape_string( $report );
$report = trim( $report );
if($report == ""){
die("textarea void");
exit();
} elseif($report == $report) {
$sql="INSERT INTO report (site_id, date, time, ticket_id, bug)
VALUES
(
'$session_id',
'$date',
'$time',
'$ticket_id',
'$report'
)";
if (!mysqli_query($con,$sql)) {
die("Failed to connect");
exit();
}
echo ("<font style='font-family:Tahoma;'>ticket sent</font>");
exit();
}
}
?>