Re: Why do I always come up with the hard stuff?

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

 



Hello,

I suspect that you need to assign the new instance of mysqli to $mysqli
by reference to prevent the on-demand instance that is created by new
from being copied (cloned) at the point of assignment.

Mark

Jason Pruim wrote:
> Yes I am hijacking a thread just to screw with all the people who use
> threaded e-mail viewers and because I'm mean like that :P
>
> Figured since yall have to much time on your hands anyway I'd give you
> something else to gripe about... :)
>
> Now... My question :)
>
> <?php
> $mysqli = new mysqli("localhost", "user", "password", "database");
>
> /* check connection */
> if (mysqli_connect_errno()) {
>     printf("Connect failed: %s\n", mysqli_connect_error());
>     exit();
> }
>
> printf("Host information: %s\n", $mysqli->host_info);
>
> /* close connection */
> $mysqli->close();
> ?>
>
> [Tue Aug  7 11:19:20 2007] [error] PHP Fatal error:  Trying to clone
> an uncloneable object of class mysqli in
> /Volumes/RAIDer/webserver/Documents/tests/legion/mysqli.php on line 2
>
>
> What is wrong with line 2? The login info is correct since I use it to
> connect with the old mysql_connect stuff and it works just fine...
> What am I missing?
>
> --PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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