Actor Form
POST BODY
".$post_data."
";
$name = $_POST["name"];
$surname = $_POST["surname"];
$country = $_POST["country"];
$age = $_POST["age"];
$sql = "INSERT INTO `actors` (`name`, `surname`, `country`, `age`) VALUES ('{$name}', '{$surname}', '{$country}', '{$age}') ";
$result = $conn->query($sql);
echo "Entry completed: {$result}";
}
// Retrieve all data from the clients table
$sql = "SELECT * FROM actors";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "
Table Contents
";
while ($row = $result->fetch_assoc()) {
echo "
id: " . htmlspecialchars($row["actor_id"]) . "
";
echo "
name: " . htmlspecialchars($row["name"]) . "
";
echo "
surname: " . htmlspecialchars($row["surname"]) . "
";
echo "
country: " . htmlspecialchars($row["country"]) . "
";
echo "
age: " . htmlspecialchars($row["age"]) . "
";
echo "
";
}
} else {
echo "No information available.";
}
?>
Director Form
POST BODY
".$post_data."
";
$name = $_POST["name"];
$surname = $_POST["surname"];
$country = $_POST["country"];
$age = $_POST["age"];
$sql = "INSERT INTO `directors` (`name`, `surname`, `country`, `age`) VALUES ('{$name}', '{$surname}', '{$country}', '{$age}') ";
$result = $conn->query($sql);
echo "Entry completed: {$result}";
}
// Retrieve all data from the clients table
$sql = "SELECT * FROM directors";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "
Table Contents
";
while ($row = $result->fetch_assoc()) {
echo "
id: " . htmlspecialchars($row["director_id"]) . "
";
echo "
name: " . htmlspecialchars($row["name"]) . "
";
echo "
surname: " . htmlspecialchars($row["surname"]) . "
";
echo "
country: " . htmlspecialchars($row["country"]) . "
";
echo "
age: " . htmlspecialchars($row["age"]) . "
";
echo "
";
}
} else {
echo "No information available.";
}
?>
Movie Form
POST BODY
".$post_data."
";
$director = $_POST["director"];
$title = $_POST["title"];
$genre = $_POST["genre"];
$prim_actor = $_POST["prim_actor"];
$year = $_POST["year"];
$sql = "INSERT INTO `movies` (`director_id`, `title`, `genre`, `primary_actor`, `year`) VALUES ('{$director}', '{$title}', '{$genre}', '{$prim_actor}', '{$year}') ";
$result = $conn->query($sql);
echo "Entry completed: {$result}";
}
// Retrieve all data from the clients table
$sql = "SELECT * FROM movies";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "
Table Contents
";
while ($row = $result->fetch_assoc()) {
echo "
id: " . htmlspecialchars($row["movie_id"]) . "
";
echo "
director: " . htmlspecialchars($row["director_id"]) . "
";
echo "
title: " . htmlspecialchars($row["title"]) . "
";
echo "
genre: " . htmlspecialchars($row["genre"]) . "
";
echo "
primary_actor: " . htmlspecialchars($row["primary_actor"]) . "
";
echo "
year: " . htmlspecialchars($row["year"]) . "
";
echo "
";
}
} else {
echo "No information available.";
}
?>