UnknownPlayer Posted December 2, 2010 Share Posted December 2, 2010 Need help with this code, if someone can help me.. // current session id $sid = session_id(); // check if the product is already // in cart table for this session $sql = "SELECT pd_id FROM tbl_cart WHERE pd_id = $productId AND ct_session_id = '$sid'"; $result = dbQuery($sql); There is a problem with $sid = session_id();, in my code, that function always get me 0 in my php code.. do i need to set this in some other way.. Anyway, there are no registred users, i just need to set session for current user.. Like this tutorial: http://www.phpwebcommerce.com/shop-add-to-cart.php Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted December 2, 2010 Share Posted December 2, 2010 is session_start() somewhere about that code snippet? if not, you'll get no session_id() Quote Link to comment Share on other sites More sharing options...
UnknownPlayer Posted December 2, 2010 Author Share Posted December 2, 2010 Thanks Is it wrong if i put this code in every page in my website ? Quote Link to comment 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.