CodeIgniter相当于send_long_data(),以避免超过mysql的最大数据包大小



我一直在到处找,找不到解决问题的方法。我试图转换一个php类,我已经在其他地方使用,如smf和wordpress到一个编码器库。目前我唯一的问题是将数据发送回数据库。问题的原因是返回的数据量超过了php.ini文件设置的打包大小,我不想更改ini文件,因为如果以后需要迁移或分发给其他人使用,这会导致问题。所以我需要的是CodeIgniter相当于。

// Send XML data in 8196 block chunks
$start=0;
// The XML data may be large in size, so we need to
// send the data in chunks to the MySQL driver to not
// exceed the max packet size for MySQL.
while ($start < strlen($xml))
{
    $end = $start + 8192; 
    if ($end > strlen($xml)) $end = strlen($xml);
    $statement->send_long_data(3,substr($xml,$start,$end-$start));
    $start = $end;
}
$start=0;
while ($start < strlen($xml))
{
    $end = $start + 8192;
    if ($end > strlen($xml)) $end = strlen($xml);
    $statement->send_long_data(4,substr($xml,$start,$end-$start));
    $start = $end;
}
$statement->execute();

我已经把问题缩小到send_long_data。我已经修改了文件中的其他所有内容,并且运行得很漂亮。有人知道正确的方法来处理最大数据包大小正确在CodeIgniter?

找到我的问题,表默认为MyISAM,需要为InnoDB。

为参考其他人的sql命令来改变这是

ALTER TABLE `tablename` ENGINE = InnoDB;

相关内容

最新更新