#34814 [Opn->Csd]: Query in a function for execution on shutdown
| From: | derick@php.net | Date: | Mon, 10 Oct 2005 17:04:48 +0000 |
| Subject: | #34814 [Opn->Csd]: Query in a function for execution on shutdown | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86355@lists.php.net to get a copy of this message | ||
ID: 34814
Updated by: derick@php.net
Reported By: egrossi at simplestnet dot com
-Status: Open
+Status: Closed
Bug Type: MySQLi related
Operating System: Win2k, WinXP
PHP Version: 5.0.5
New Comment:
Good, that means it's fixed then :)
Previous Comments:
------------------------------------------------------------------------
[2005-10-10 19:00:20] egrossi at simplestnet dot com
Work well with this CVS snapshot of 2005 oct 10:
http://snaps.php.net/win32/php5.0-win32-latest.zip
------------------------------------------------------------------------
[2005-10-10 18:44:45] derick@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.0-win32-latest.zip
------------------------------------------------------------------------
[2005-10-10 18:38:58] egrossi at simplestnet dot com
Description:
------------
SQL Query like INSERT, inside a function called by
register_shutdown_function() doesn't work on PHP 5.0.5 but work
perferctly in PHP 5.0.4 and before or with MySQL extension.
Note: the MySQL link identifier is created and passed in arguments of
shutdown function.
Reproduce code:
---------------
function cb_shutdown( $lk ) {
mysqli_query($lk, "INSERT INTO
log
(ip, data)
VALUES ('127.0.0.1', 'test')");
}
$link = mysqli_connect( "localhost", $db_user, $db_pass, $db_name);
register_shutdown_function("cb_shutdown", $link);
Expected result:
----------------
A new record in log table.
Actual result:
--------------
No record added and warning:
Couldn't fetch mysqli
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34814&edit=1