#33635 [Opn->Asn]: "couldn't fetch mysqli" error when attempting to write session data to db
| From: | sniper@php.net | Date: | Mon, 11 Jul 2005 23:08:13 +0000 |
| Subject: | #33635 [Opn->Asn]: "couldn't fetch mysqli" error when attempting to write session data to db | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81698@lists.php.net to get a copy of this message | ||
ID: 33635
Updated by: sniper@php.net
Reported By: tony at marston-home dot demon dot co dot uk
-Status: Open
+Status: Assigned
Bug Type: MySQLi related
Operating System: Windows XP
PHP Version: 5CVS-2005-07-10 (dev)
-Assigned To:
+Assigned To: georg
New Comment:
Assigned to the author of the extension, who can propably explain this
better..
Previous Comments:
------------------------------------------------------------------------
[2005-07-11 23:55:55] tony at marston-home dot demon dot co dot uk
You are completely mistaken. I am not mixing both OO and procedural
ways of accessing the DB - all my calls to the mysqli_* functions are
in the procedural style. The fact that I am making these calls inside
my own OO class should be totally irrelevant.
The same code has worked perfectly through php 5.0.0 to 5.0.4, and with
5.0.5-dev only fails when I try to write my session data to the
database. SOMETHING HAS BEEN INTRODUCED IN 5.0.5-dev THAT CAUSES THIS
FAILURE.
My use of static variables follows the documentation for the singleton
pattern at http://www.php.net/manual/en/language.oop5.patterns.php.
It
allows to to call mysqli_connect() only once for a request.
------------------------------------------------------------------------
[2005-07-11 22:48:09] sniper@php.net
Please read the friendly manual about Mysqli. You're trying to mix both
OO and procedural way of accessing the DB. Choose one and stick to
that. (And I don't get the idea of making the connection 'static'
either..especially if you deal with OOP)
------------------------------------------------------------------------
[2005-07-11 12:33:45] tony at marston-home dot demon dot co dot uk
Whoops. That URL should be http://www.tonymarston.net/test.zip
------------------------------------------------------------------------
[2005-07-11 11:59:48] tony at marston-home dot demon dot co dot uk
I have changed the test set as follows:
(a) Everything is in a single file (test.php)
(b) I have removed the PHP 4 code (=& with objects)
(c) I have removed redundant methods.
New test set is available at http://www.tonymarston.net/text.zip
------------------------------------------------------------------------
[2005-07-11 09:09:47] sniper@php.net
1. Put everything in single file
2. Remove the PHP4 stuff (in PHP5, you don't need to do =& with
objects, for example)
3. Remove all unused methods
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/33635
--
Edit this bug report at http://bugs.php.net/?id=33635&edit=1