project3 Posted March 31, 2008 Share Posted March 31, 2008 I have a cart that stores the items in the db during adding the item to the cart. the values are tied to the session. the session number is like this e8c386c9fc2ff3d4d431ede9deee7ca5. how can i get that value so that I can do some queries against it in the db. Link to comment https://forums.phpfreaks.com/topic/98750-session-problem/ Share on other sites More sharing options...
ohdang888 Posted March 31, 2008 Share Posted March 31, 2008 $number = $_SESSION['number']; $result = mysql_query("SELET * FROM `table` WHERE `user_number`='$number' ") or die(mysql_error()) Link to comment https://forums.phpfreaks.com/topic/98750-session-problem/#findComment-505324 Share on other sites More sharing options...
project3 Posted March 31, 2008 Author Share Posted March 31, 2008 $number = $_SESSION['number']; $result = mysql_query("SELET * FROM `table` WHERE `user_number`='$number' ") or die(mysql_error()) That would only work if one of the session value names was number. I know how to do the sql. what i need is the number that all the session values is under. that number is stored on the server I believe. I know the cart gets that number and uses it so there has to be a way i can too. Link to comment https://forums.phpfreaks.com/topic/98750-session-problem/#findComment-505327 Share on other sites More sharing options...
project3 Posted March 31, 2008 Author Share Posted March 31, 2008 what i want is the session id. Ive tried $PHPSESSID but that doesn't seem to work. Link to comment https://forums.phpfreaks.com/topic/98750-session-problem/#findComment-505332 Share on other sites More sharing options...
darkhappy Posted March 31, 2008 Share Posted March 31, 2008 php session names from from here: <?php session_start(session_name); i think you would have to dig into your cart script to see where that ID is coming from - could be an encrypted session name or cookie? you could store any variable into a SQL database with MD5 encryption and it would look like that. Link to comment https://forums.phpfreaks.com/topic/98750-session-problem/#findComment-505339 Share on other sites More sharing options...
project3 Posted March 31, 2008 Author Share Posted March 31, 2008 php session names from from here: <?php session_start(session_name); i think you would have to dig into your cart script to see where that ID is coming from - could be an encrypted session name or cookie? you could store any variable into a SQL database with MD5 encryption and it would look like that. yeah thats what i did. i just found where its setting that id in the db. and set a session for it and works good. thanks. Link to comment https://forums.phpfreaks.com/topic/98750-session-problem/#findComment-505341 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.