Jump to content
Larry Ullman's Book Forums

Recommended Posts

In Chapter 19, the $_SESSION['customer_id'] variable is often used for things like isset($_SESSION['customer_id'])

why though can't we use other table columns that are like customer_id in the $_SESSION[]

for example $_SESSION['order_id']


In chapter 19 also, the $_GET['id'] is the same id as the customer's. Why is it the same? Where does it get declared as the same, I have searched through the scripts and I don't see it. 


I am trying to create a script where users can view their past orders. The trouble I am having is calculating the total amount of the order in the checkout.php script, because there is no customer_id field in the order_contents table. 

Here is where I am at with that in the checkout.php script: 

$u = "SELECT price * quantity AS amount FROM order_contents WHERE order_id=?not sure what to put here";
$total = mysqli_query($dbc, $u);

Share this post

Link to post
Share on other sites

It's not exactly clear to me what you're asking about here. Could you clarify what the point(s) of confusion is(are)?

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...