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);
Link to comment
Share on other sites

  • 2 weeks later...
 Share

×
×
  • Create New...