|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-05-10 21:43 UTC] sicommnend at gmail dot com
Description:
------------
If you connect to a SQLite3 database in the ob_start callback function then the
script exits without any output and the database doesn't get written to.
In the test script if you move the SQLite3 database code out of the callback
function the script works, however it fails if there is any connection to a
SQLite3 database withing the callback function.
Test script:
---------------
<?php
ob_start('callbackfunc');
echo 'test test test test test test test test test ';
function callbackfunc($buffer) {
return $buffer;
}
$DB = new SQLite3('db');
$DB->exec('CREATE TABLE test (one int, two text);');
$DB->exec('INSERT INTO test VALUES (10, \'some text\')');
?>
Expected result:
----------------
The database gets written to and the output gets sent.
Actual result:
--------------
Script exits with no output and database is not created.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 05:00:01 2025 UTC |
The test script I posted above will suceed, this is the one that will fail. Got my testing scripts mixed up there. <?php ob_start('callbackfunc'); echo 'test test test test test test test test test '; function callbackfunc($buffer) { $DB = new SQLite3('db'); $DB->exec('CREATE TABLE test (one int, two text);'); $DB->exec('INSERT INTO test VALUES (10, \'some text\')'); return $buffer; } ?>