Re: strange mysqli error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Aug 23, 2006, at 2:33 AM, Jochem Maas wrote:

how do you know which object is destroyed first?

also you are using 3 different versions of php - not something that will
help narrow down the problem.

Richard K Miller wrote:
Good afternoon.  I'm getting a weird mysqli error in my object
destructor.  Here's an example:

<?php

$db = new mysqli('localhost', USERNAME, PASSWORD, DATABASE);

class Test
{
    function __construct()
    {
        global $db;

        $db->query("SELECT 'test'");
        print_r($db->error);
    }

    function __destruct()
    {
        global $db;

        $db->query("SELECT 'test'");  // line 20
        print_r($db->error);  // line 21
    }
}

$test = new Test();

what happens if you add the following line:

unset($test);


No errors when I use unset(). I see what you mean about not knowing which object is destroyed first. Maybe I'll have to use a non-OOP connection to MySQL, since it wouldn't appear there's any way to specify the order of destruction of objects.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux