0

如何清理数据以使其不会导致任何错误?我正在运行 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;
4

0 回答 0