Question: Use this Code to answer the following three questions The starting code for the index php tile which is the first page of an application
Use this Code to answer the following three questions The starting code for the index php tile which is the first page of an application requiredatabase.php'; $category-id-S GET.categor.id.); Asset (Seategory id)) seategory idi // Routine 1 squerySELECT FROM categories WHERE eategory ID Seategory id* scategory ab-query(sqoery) a $category Scategory-fetch 0 seategory hame-Seategoryl'category Name'1 / Routine 2 querySELECTTROM products WHERE category ID- Scategory id ORDER BY ProutID $products Sdb->query (Squery) 32 (Refer to eode above) The firat atatement in this example geta and rum a file named database.php. What must this code do for the rest of the statenents in this exanple to work? Create a P0oStatement object naned Sdb that conects to the right database b. Create a Post atenent object naned $db) that cornect# to ts e. Create a PD0 objeet haned Sab that conneets to the right database d. Create a PDO object naned Sdb-> that connects to the right database 33. (Refer to code above) What does routine 1 stoce in the variable naned category name? The category name for the first row in the categories table of the b The category name for the row in categories table that corresponds e The category name for the row in categories table that has a d. An array of the category names in the categor ies table dat abase to the value in seategory id category ID of 1 34 (Refer to e0de above) What does routin. 2 store in the variable nated produets A POO8tatement objeet for all rows in the prodacts table b. A ootatment object for the columna in the fsrat row in the products table .A 00statement object for the Eows in the products table that have a category ID equal to the value in Scategory id d. A 006tat ement object for the rows in the products table that have a ea tego ry IDqual to 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
