Re: anyone succeed?

From: Date: Thu, 02 Nov 2000 00:40:09 +0000
Subject: Re: anyone succeed?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-23281@lists.php.net to get a copy of this message
deryk writes: > as following: > <? $link=mysql_connect("host","user","pass"); > session_register("link");?> > i want to transfer this link var to another page via session function > my session works well,i've tried on other vars and the $link i get is > ok too,but just i can't transfer it correctly to another page,i also > tried mysql_pconnect(),it's the same ,anyone ever did the same thing > and succeeded? > thx > deryk The link is just the identifier of an internal resource, which is the actual 'link' to the server. So passing the $link variable may, indeed, mean that a variable named $link with the same value will show up in the next page; however, since you're now on a completely new invocation of the PHP engine, the actual server link to which the identifier referred is now gone. In other words, it won't work. Why would you want to do that, anyway? If you want to access the server again, just connect again; if you want to avoid the overhead of creating a new link on each and every page load, use mysql_pconnect() as documented. What result are you going for here? -- +----------------------------------------------------------------+ |Torben Wilson <torben@php.net> Netmill iTech| |http://www.coastnet.com/~torben http://www.netmill.fi| |Ph: 1 250 383-9735 torben@netmill.fi| +----------------------------------------------------------------+

« previous php.general (#23281) next »