29]Consider the following entities and their relationships
Actor
(actor_no, name)
Create a
RDB in 3NF for the above and solve following Using above database,
a)Accept
actor name and display the names of the movies in which he has acted.
b)Insert
new movie information.
c)Update
the release year of a movie. (Accept the movie name from user)(PHP 7)
<body>
<table
border="1">
<tr><td><input
type="radio" name="rad" value="1"></td>
<td>Enter
Actor Name : <input type="text"
name="aname"></td/></tr>
<tr><td><input
type="radio" name="rad" value="2"></td>
<td>Enter
Movie Information:</td>
<td>Movie
name : <input type="text"
name="mname1"></td>
<td>Release
Year : <input type="text" name="ryear1"></td>
</tr>
<tr><td><input
type="radio" name="rad" value="3"></td>
<td>Update
Movie Release Year</td>
<td>Enter
Moive Name: <input type="text" name="mname"></td>
<td>Enter
updated year: <input type="text"
name="ryear"></td></tr>
<tr><td><input
type="submit" name="submit"
value="Submit"></td></tr>
</form>
</body>
</html>
S29.php
$database="archana2";
$con
=mysqli_connect("localhost","root" ,"");
if
(!$con)
{
die('Could
not connect: ' . mysqli_error());
}
mysqli_select_db
($con,"$database");
switch($ch)
{
case
'1': $aname=$_POST['aname'];
$query="select mname from movie where mno in(select mno from movie_actor
where ano in(select ano from actor where aname='".$aname."'))";
$result=mysqli_query($con,$query);
if(!$result)
{
echo
"Some error occured";
break;
}
while($row=mysqli_fetch_array($result))
{
echo
''.$row[0].'';
echo
"<br>";
}
break;
$ryear=$_POST['ryear1'];
$query="insert
into movie values('', '".$mname."', '".$ryear."')";
$result=mysqli_query($con,$query);
if(!$result)
{
echo
"Some error occured";
break;
}
echo
"Inserted new record successfully <br><br>";
break;
$ryear=$_POST['ryear'];
$query="update
movie set ryear='".$ryear."' where
mname='".$mname."'";
$result=mysqli_query($con,$query);
if(!$result)
{
echo
"Some error occured";
break;
}
echo
"Updated information successfully";
break;
}
mysqli_close($con);