Sdb-new PDO('mysql:host-localhost;dbname-ordersDB;charset-utf8', 'root', 'abc123); Sdb->setAttribute(PDO::ATTR_ERRMODE, PDO:ERRMODE EXCEPTION); Assume the user has added several products in his shopping cart and all his selection is stored in PHP Session variable using the following data structure: When the user log-in successfully, his ID is stored as follows: $_SESSION['activeUserID'J-SUserID; for each Product in the shopping cart: $ SESSION[SUserlID][SProductName] = array($Quantity, SUnitPrice); Implement placeOrder.php as follows: the script should process all products info from the User shopping cart SESSION and insert them into the orders and orderItems tables. Your script should insert the userID, order total amount and order date and time into the orders table and then insert each product details in the orderItems table. Your script should make sure All details are inserted successfully or none of them. In addition, you should insert all products items into the OrderItems table using PDO PREPARED STATEMENTS.
Sdb-new PDO('mysql:host-localhost;dbname-ordersDB;charset-utf8', 'root', 'abc123); Sdb->setAttribute(PDO::ATTR_ERRMODE, PDO:ERRMODE EXCEPTION); Assume the user has added several products in his shopping cart and all his selection is stored in PHP Session variable using the following data structure: When the user log-in successfully, his ID is stored as follows: $_SESSION['activeUserID'J-SUserID; for each Product in the shopping cart: $ SESSION[SUserlID][SProductName] = array($Quantity, SUnitPrice); Implement placeOrder.php as follows: the script should process all products info from the User shopping cart SESSION and insert them into the orders and orderItems tables. Your script should insert the userID, order total amount and order date and time into the orders table and then insert each product details in the orderItems table. Your script should make sure All details are inserted successfully or none of them. In addition, you should insert all products items into the OrderItems table using PDO PREPARED STATEMENTS.
Chapter1: Overview Of Database Concepts
Section: Chapter Questions
Problem 5HOA: Access path A database table is composed of records and fields hold data. Data is stored in records....
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you