I am storing a database link identifier as a session variable but when I switch pages the link identifier dies. When I do a var_dump() of the identifier after switching pages I get "int(0)". Any reason why and how can I keep this open? I tried to use mysql_pconnect instead but it doesn't work as well.
Your MySQL connection is closed when your script ends, so the link is useless at that point. You must reestablish the connection with each script. And in any case, as stated in http://www.php.net/manual/en/ref.session.php
Warning Some types of data can not be serialized thus stored in sessions. It includes resource variables or objects with circular references (i.e. objects which passes a reference to itself to another object).
Warning
Some types of data can not be serialized thus stored in sessions. It includes resource variables or objects with circular references (i.e. objects which passes a reference to itself to another object).
(my emphasis)
I see, so what if I have a database object and within the constructor I establish the connection to the database, would you see that I need a function that re-establishes the connection and call it on every page?
never mind, I got it, thanks NogDog.