kerbdog Posted February 19, 2011 Share Posted February 19, 2011 Hi Can some steer me in the right direction. I am having issues subtotaling 2 session variables: <td>'.$_SESSION['itemqty'][$key].'*'.$_SESSION['itemprice'][$key].'</td> Can you advise if I am doing this right? Cheers Quote Link to comment https://forums.phpfreaks.com/topic/228162-session-variables/ Share on other sites More sharing options...
ale8oneboy Posted February 19, 2011 Share Posted February 19, 2011 The code you have provided would display the qty, an * and then the price. I believe you're looking for this: echo '<td>'.($_SESSION['itemqty'][$key] * $_SESSION['itemprice'][$key]).'</td>'; The difference is this code would compute the sub-total then display it. Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/228162-session-variables/#findComment-1176608 Share on other sites More sharing options...
kerbdog Posted February 19, 2011 Author Share Posted February 19, 2011 Thanks heaps, that helped alot..... Quote Link to comment https://forums.phpfreaks.com/topic/228162-session-variables/#findComment-1176609 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.