Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4,6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 11 pages
Summary

Summary ict3612 assignment3

Document preview thumbnail
Preview 2 out of 11 pages

ict3612 assignment3 php code , please not you need to create your db and website on webhost by yourself , unfortunately i cannot do so

Content preview

Assignment 3 ict3612


Disclaimer: Responsibilities for Code Integration

Before using the provided PHP code to connect to your database, please note that you are responsible
for:
Matching the code to your specific database configuration.
Creating a database with actual data using phpMyAdmin or another tool.
Ensure you understand PHP and MySQL basics, and back up your database before making any
changes. Test and debug the integration as needed. Disclaimer: Responsibilities for Code Integration

Before using the provided PHP code to connect to your database, please note that you are responsible
for:
Matching the code to your specific database configuration.
Creating a database with actual data using phpMyAdmin or another tool.
Ensure you understand PHP and MySQL basics, and back up your database before making any
changes. Test and debug the integration as needed.




Task 1: Chapter 16: page name=task1.php

Table of thespians:

Contains: Details about the performers involved in cinematic productions.
Main Identifier: ActorID (a distinctive marker for each actor).
Movie Player Roles Table:

Depicts: The character portrayals enacted by actors in specific movies.
Main Identifier: FilmActorRoleID (a unique label for each film actor role).
Referring Identifiers: ActorID (linked to the Thespians table to identify the actor), FilmTitleID (connected
to the Film Titles table to recognize the movie title), RoleTypeID (linked to the Role Categories table to
distinguish the role type).
Film Titles Log:

Captures: Data concerning individual motion pictures.
Main Identifier: FilmTitleID (an exclusive mark for each film title).
Role Categories Archive:

Encompasses: Various classifications of roles actors can undertake in movies.
Main Identifier: RoleTypeID (an individualized code for each role category).

, To summarize the interrelationships among the tables:

Thespians Table (1) to (N) Movie Player Roles Table: An actor can undertake numerous movie roles.
Role Categories Table (1) to (N) Movie Player Roles Table: A role category can be associated with
multiple movie player roles.
Movie Player Roles Table (N) to (1) Film Titles Log: Several movie player roles can be linked to a single
film title.



Task 2: Chapter 16, 17, 18, 19: page name=task2.php


<?php

// database credentials
$host = 'localhost';
$username = ''; //place you username
$password = '';//password
$database = '';//database name

// Connect to the database
$conn = mysqli_connect($host, $username, $password, $database);

// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}

// Fetch data from all five tables
$tables = ['users', 'products', 'orders', 'categories', 'product_categories'];
$tableData = [];

foreach ($tables as $table) {
$query = "SELECT * FROM $table";
$result = mysqli_query($conn, $query);
$tableData[$table] = mysqli_fetch_all($result, MYSQLI_ASSOC);
}

// Display data in HTML tables
echo '<h1>Database Tables</h1>';
foreach ($tableData as $tableName => $data) {
echo "<h2>$tableName Table</h2>";
echo '<table border="1">';
echo '<tr>';
foreach ($data[0] as $column => $value) {
echo "<th>$column</th>";

Document information

Uploaded on
July 30, 2023
Number of pages
11
Written in
2022/2023
Type
Summary
R400,00

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
phegelelo
5,0
(1)
Sold
17
Followers
15
Items
12
Last sold
2 year ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions