mysqli unclonable object

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

 



On a Fedora 4 machine running MySQL 4.1 I am having trouble declaring an 
instance of a mysqli extension.

class Data extends mysqli {
    function __construct($host, $user, $password, $db = null)
    {
        @parent::__construct($host, $user, $password, $db)
        or printf("There was an error (id: %d) connecting to the database:
           <b>%s</b><br />", mysqli_connect_errno(), 
mysqli_connect_error());
    }

    ....

}

$link = new Data("localhost", "user", "password", "db");

This invokes the error "Trying to clone unclonable object of type Data." 
However if I create the link with a reference ...
    $link =& new Data(....);
...everything works fine.

This error is interesting because it only occurs on the machine mentioned 
above, in a Windows/MySQL 5.0 environment, everything works fine without the 
reference.


Thanks in advance!
Matt 

-- 
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