Jump to content

Archived

This topic is now archived and is closed to further replies.

uglykidjoe

PHP session

Recommended Posts

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 any
idea on how to save that db handle ...
Any hints would be greatly appreciated.
Thank You.

Unsuitable 'joke' removed.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[!--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

Share this post


Link to post
Share on other sites
[!--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--]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.