|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-10 22:11 UTC] tony at marston-home dot demon dot co dot uk
[2005-07-10 22:23 UTC] tony2001@php.net
[2005-07-10 23:44 UTC] tony at marston-home dot demon dot co dot uk
[2005-07-10 23:59 UTC] sniper@php.net
[2005-07-11 00:12 UTC] tony at marston-home dot demon dot co dot uk
[2005-07-11 09:09 UTC] sniper@php.net
[2005-07-11 11:59 UTC] tony at marston-home dot demon dot co dot uk
[2005-07-11 12:33 UTC] tony at marston-home dot demon dot co dot uk
[2005-07-11 22:48 UTC] sniper@php.net
[2005-07-11 23:55 UTC] tony at marston-home dot demon dot co dot uk
[2005-07-12 01:08 UTC] sniper@php.net
[2005-07-15 09:41 UTC] tony at marston-home dot demon dot co dot uk
[2005-07-19 21:45 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 13:00:01 2025 UTC |
Description: ------------ In my script I use a custom session handler to write all session data to the database. Through versions 5.0.0 to 5.0.4 this worked as expected, but with 5.0.5dev I am now getting an error. It only ever failos at the end of the script when writing out the session data. It always fails at the same place by generating a "Couldn't fetch mysqli" error. Reproduce code: --------------- function connect ($dbname) // establish a connection to the database { global $dbhost, $dbusername, $dbuserpass; static $dbconn; if (!$dbconn) { $dbconn = mysqli_connect($dbhost, $dbusername, $dbuserpass); if ($dbconn) { // use UTF8 for this connection $this->query = "SET names 'UTF8'"; $result = mysqli_query($dbconn, $this->query) or trigger_error($this, E_USER_ERROR); } // if } // if if (!$dbconn) { <== FAILS HERE ********************* return false; } elseif (!mysqli_select_db($dbconn, $dbname)) { return false; } else { $this->dbconnect = $dbconn; return true; } // if } // connect The full code is available from http://www.tonymarston.net/text.zip. The script to run is "test.php". Expected result: ---------------- At that point $dbconn is shown to be "object of mysqli", so it should not error. Actual result: -------------- At the line "if (!$dbconn)" the program jumps immediately to my error handler with the error "Couldn't fetch mysqli".