uglykidjoe Posted May 20, 2006 Share Posted May 20, 2006 Hi,Guys, I would like to get a help on how to pass a mysql link id from one page to another using session!I dont want to connect/select_db for each page that needs to query a DB... so thats why i wonder if there's anyidea on how to save that db handle ...Any hints would be greatly appreciated.Thank You.Unsuitable 'joke' removed. Quote Link to comment https://forums.phpfreaks.com/topic/10062-php-session/ Share on other sites More sharing options...
toplay Posted May 20, 2006 Share Posted May 20, 2006 I don't believe you can and you wouldn't really want to.Even with mysql_pconnect() use, you still have to make the function call so it gets a chance to find an existing link available (if any):[a href=\"http://us2.php.net/manual/en/function.mysql-pconnect.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.mysql-pconnect.php[/a]Good luck. Quote Link to comment https://forums.phpfreaks.com/topic/10062-php-session/#findComment-37423 Share on other sites More sharing options...
uglykidjoe Posted May 21, 2006 Author Share Posted May 21, 2006 [!--quoteo(post=375497:date=May 20 2006, 09:01 AM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ May 20 2006, 09:01 AM) [snapback]375497[/snapback][/div][div class=\'quotemain\'][!--quotec--]I don't believe you can and you wouldn't really want to.Even with mysql_pconnect() use, you still have to make the function call so it gets a chance to find an existing link available (if any):[a href=\"http://us2.php.net/manual/en/function.mysql-pconnect.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.mysql-pconnect.php[/a]Good luck.[/quote]Thank you toplay, guess i'll have to do it the hard way Quote Link to comment https://forums.phpfreaks.com/topic/10062-php-session/#findComment-37586 Share on other sites More sharing options...
jeremywesselman Posted May 21, 2006 Share Posted May 21, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Thank you toplay, guess i'll have to do it the hard way[/quote]What do you consider the hard way? Typing the connection on every page? Yes, that is the hard way.Just put your connection data in one file and just include it at the top of every page. Better than typing it on every single page![!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--] Quote Link to comment https://forums.phpfreaks.com/topic/10062-php-session/#findComment-37594 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.