NYCPHP Meetup

NYPHP.org

[nycphp-talk] mysql_close() error

Adam Maccabee Trachtenberg adam at trachtenberg.com
Tue Dec 21 18:08:12 EST 2004


On Tue, 21 Dec 2004, Frank Wong wrote:

> the var $link from function two is automatically referenced by function one
> even though I did not pass it in?
>
> Sorry if this is a newbie question.  Thanks.

Actually, it has nothing to do with lexical scoping. It's more subtle
than that.

I believe that if you try to make a second connection to MySQL via PHP
that's identical to an existing connection, then PHP will reuse the
first connection. That's why mysql_connect() returns the same resource
handle.

-adam

-- 
adam at trachtenberg.com | http://www.trachtenberg.com
author of o'reilly's "upgrading to php 5" and "php cookbook"
avoid the holiday rush, buy your copies today!



More information about the talk mailing list