Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I don't want a 100% solution, just the basics because I don't have time please , i will give like Question 4 MOLPHIN Ayos la

I don't want a 100% solution, just the basics because I don't have time please , i will give like

image text in transcribed
image text in transcribed
image text in transcribed
Question 4 MOLPHIN Ayos la ORDERS le My Tehler anders Table IMP hem) prout WETU www Note: antered in a foreign kry to an customer ander Sample Dale Table customer wie Tome arder_ de date status M. 2011-11-04 00:00:00 Order Placed noor 22-11-04 00:00:00 Dec + Use the following connection.php by including it in your scripts, which connects you MySQL server and the database setAttribute(PDO::ATTR_ERRMODE, PDO ERRMODE EXCEPTION):) 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 S_SESSION[CART') holds an associative array whose key is the product id and its value is the quantity selected. 04-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. Tesde - - 2, A,e, I g . pro Servey Question 14 Refer to Question 4 for Database Details 04-B: Write the required PHP statements to display all users orders in an HTML Table as follows: Username Order Date Time Number of Items Total Qty Order Status falqaed 2021-11-04 00:00:00 4 Order Placed noor 2021-11-04 00:00:00 2 3 Order Placed 4 Note that Number of Items is the number of different products in one order, while Total Qty is the sum of all quantities inside one order. Tip: use SQL Group By and built-in functions like count and sum Question 4 MOLPHIN Ayos la ORDERS le My Tehler anders Table IMP hem) prout WETU www Note: antered in a foreign kry to an customer ander Sample Dale Table customer wie Tome arder_ de date status M. 2011-11-04 00:00:00 Order Placed noor 22-11-04 00:00:00 Dec + Use the following connection.php by including it in your scripts, which connects you MySQL server and the database setAttribute(PDO::ATTR_ERRMODE, PDO ERRMODE EXCEPTION):) 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 S_SESSION[CART') holds an associative array whose key is the product id and its value is the quantity selected. 04-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. Tesde - - 2, A,e, I g . pro Servey Question 14 Refer to Question 4 for Database Details 04-B: Write the required PHP statements to display all users orders in an HTML Table as follows: Username Order Date Time Number of Items Total Qty Order Status falqaed 2021-11-04 00:00:00 4 Order Placed noor 2021-11-04 00:00:00 2 3 Order Placed 4 Note that Number of Items is the number of different products in one order, while Total Qty is the sum of all quantities inside one order. Tip: use SQL Group By and built-in functions like count and sum

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. Existing organizations and programs constrain behavior.

Answered: 1 week ago