警告:PDOStatement :: execute():message:字符串后面的未闭合引号

时间:2013-04-05 20:22:33

标签: php sql-server ubuntu

如何清理数据以免造成任何错误?我正在运行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;

0 个答案:

没有答案