Question: text Question 5 MySQL/PHP Assume you have a blogExam database stored in MySQL server that contains the following tables with unknown number of rows Table:

text Question 5 MySQL/PHP Assume you have a blogExam database stored in MySQL server that contains the following tables with unknown number of rows Table: categories Table: blogs Field Type Field Type id int(11) int(11) title name varchar(100) varchar(100) contents picture varchar(100) picture varchar(100) views int(11) categoryID int(11) Sample Data in the Table: categories id name picture views 1 Electronics elec222.jpg 15 2 Furniture furn 111.jpg 8 3 Books book 123.jpg Sample Data in the Table: blogs id title contents picture categoryID 1 JavaScript Because JavaScript has a reasonable claim to java.jpg 3 Claims being Use the following connection.php by including it in your scripts which connect you to MySQL server and the database. setAttribute(PDO:ATTR_ERRMODE, PDO:ERRMODE_EXCEPTION}:) 2 MySQL server can be accessed using root as username and abc123 as password. Q3-A: Write the following PHP programs as required below: 1. viewCategories.php: display all categories pictures, names and number of views in grid view (max 2 categories for each row) as shown below. When the user clicks on the picture or the name, the program should submit the category ID to views.php program. [10 Marks Electronics(15 Views) Furniture(8 Views) 7 of 7 Electronics(15 Views) Furniture(8 Views) 6 2. views.php: increment the selected category views by 1 and then display all blogs in that category as shown below (sample output for 1 blog). Only the first 100 characters for each blog's content should be displayed. [10 Marks] (Hint: use x-substr(STRING, START INDEX, NU OP CHARACTERS) >) JAVA JavaScript Claims Because JavaScript has a reasonable claim to being the world's most misunderstood programming langua
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
