Jump to content

Need help about shopping cart, session...


UnknownPlayer

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/220475-need-help-about-shopping-cart-session/
Share on other sites

Archived

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

×
×
  • Create New...

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.