如何清理数据以免造成任何错误?我正在运行ubuntu,php 5.3并连接到mssql。
这是我的代码:
$body = $this->get_part($imap, $b, "TEXT/HTML");
if($body == "")
{
$body = $this->get_part($imap, $b, "TEXT/PLAIN");
}
$header = imap_headerinfo($imap, $b);
$subject = $header->subject;
$fromaddress = $header->fromaddress;
$body = str_replace("'", "''", $body);
//$body = str_replace("\"", "\"\"", $body);
/////////////////////////////
$data = array('content'=>$body);
$query = $PDO->prepare('insert into [tbl_test] (content) values (:content)');
$query->execute($data);
break;