<html>

<head>
<title>Films</title>
<link rel="stylesheet" type="text/css" href="css/guestbookform.css" />
</head>

<body>

<?php
$con = mysql_connect("localhost","******","******");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("******", $con);

//get  the values posted from the form (i.e. what user entered in the form) and add them to local variables

$filmid = $_POST['filmid'];
$filmtitle = $_POST['filmtitle'];
$filmyear = $_POST['filmyear'];
$filmrating = $_POST['filmrating'];
$filmdesc = $_POST['filmdesc'];
$filmtrailer = $_POST['filmtrailer'];
$filmofficialurl = $_POST['filmofficialurl'];
$filmcert = $_POST['filmcert'];

$sql="UPDATE php_films SET filmtitle='$filmtitle', filmyear='$filmyear', filmrating='$filmrating', 
filmdesc='$filmdesc', filmtrailer='$filmtrailer', filmofficialurl='$filmofficialurl', filmcert='$filmcert'
WHERE filmid='$filmid' ";
echo $sql;

if (!mysql_query($sql,$con))
{
die ('Error: ' . mysql_error());
}

echo "<h1>1 record was just updated in the database.</h1>";

//close the connection to the database.

mysql_close($con); 
?>

<br><br>
<form method="LINK" action="films2.php">
<input type="submit" value="Back to list">
</form>


</body>
</html>