Question: 20 Points Question 4 MySQL PHP Assume you have an ORDERS database stored in MySQL server that contains the following tables with unknown number of

 20 Points Question 4 MySQL PHP Assume you have an ORDERSdatabase stored in MySQL server that contains the following tables with unknown

20 Points Question 4 MySQL PHP Assume you have an ORDERS database stored in MySQL server that contains the following tables with unknown number of rows: Table: customer_orders Tablet order Items Mame Type Name Type 1 ld Int(11) id int(11) 2 username varchar(100) orderld int(11) 3 datetime datetime productid int(11) 4 status varch (100) qty int(11) Note: ordered is a foreign key to an id in customer_orders Sample Data Table: customer_orders Table: order_items id username datetime status id orderid productid aty 11 2 2 2021-11-04 00:00:00 Order Placed 1 1 falgaed 21 5 2 noor 2021-11-04 00:00:00 Order Placed 31 1 3 1 1 1 5 2 2 2 2 1 62 5 Use the following connection.php by including it in your scripts, which connects you to MySQL server and the database. setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE EXCEPTION);} minutes remaining cer 080 12 16 6 z' N # % 5 0 & 6 7 7 V 8 N 4 2 Y 3 U D TY! 1 1 52 2 2 Use the following connection.php by including it in your scripts, which connects you to MySQL server and the database. setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);} ?> Assume a user has logged in successfully and added many products of different quantities in his shopping basket. All this information is saved in Session Variables as follows: $_SESSION['activeUser'] holds the username $_SESSION[CART"] holds an associative array whose key is the product id and its value is the quantity selected. . Q4-A: Write the required PHP statements to insert the customer order from the shopping basket into the two database tables. Your code must ensure that the order is completely inserted successfully or not. In addition, you must use prepared statement to insert the order items. Once inserted all, your code should display the number of items inserted successfully in green color. Use the editor to format your answer 23 minutes remaining 1080 10 17 F4 DO * & A % V 8 $ 4. # 3 6 5 2 LYI U R

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!