Prev | Current Page 643 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"


??? Add customer_id, auth_code, and reference fields. The customer_id field references the
customer table, specifying the customer who made the order. The other two fields are
related to processing credit card data and will be discussed in Chapter 20.
We??™ll also modify the shopping_cart_create_order stored procedure to reflect the
changes in the orders table. Follow the steps in the exercise to change the orders table
and the shopping_cart_create_order stored procedure.
Exercise: Adding Orders to Customer Accounts
1. Load phpMyAdmin, select the tshirtshop database, and open a new SQL query page.
?– Caution Be sure to back up your data, as you??™re going to delete the data in the order_detail and
orders tables.
2. Next, use the query page to execute this code, which deletes the data stored in order_detail and
orders tables from your tshirtshop database.
-- Delete all records from order_detail table
TRUNCATE TABLE order_detail;
-- Delete all records from orders table
TRUNCATE TABLE orders;
3. Drop the customer_name, shipping_address, and customer_email fields from the orders table;
they are no longer required. This data is now held in the customer table.
-- Drop customer_name, shipping_address and customer_email fields
-- from the orders table
ALTER TABLE `orders` DROP COLUMN `customer_name`,
DROP COLUMN `shipping_address`,
DROP COLUMN `customer_email`;
CHAPTER 17 ?–  STORING CUSTOMER ORDERS 544
4.


Pages:
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655
teksty pl Margo Mario Mike and the Mechanics Manfred Mann