I have been sitting here for 30mins and I cannot find why this is not working.
Its a simple insert query for a mysql database table but it doesn't add the data, no error appears so I have no idea why it isn't working, may be my lack of experience but I have scanned through this code and cannot find any mistake. If it is something simple then I do apologise for wasting your time.
if($_POST['action'])
{
$key=$_POST['Key'];
$serial=$_POST['Serial'];
$version=$_POST['Version'];
$query="INSERT INTO List (ID, Key, Serial, Version) VALUES (NULL, '$key', '$serial', '$version')";
$rez=mysql_query($query);
header("Location: index.php");
}
?>
<style type="text/css">
<!--
form { font-family: "Courier New", Courier, mono}
body { font-family: "Times New Roman", Times, serif}
-->
</style>
<center>
<form action="" method="POST">
<h1> Add Key </h1>
<br>
Key:<br><input type="text" name="Key">
<br/>
Serial #:<br><input type="text" name="Serial"><br/>
<br/>
Version:<br> <select name ="Version">
<option value="2010">2010</option>
<option value="2013">2013</option>
<option value="2016">2016</option>
</select>
<br/>
<br/>
<br><input type="submit" name="action" value="Add Key">
<input type="reset" value="Reset">
</form>
<a href="index.php">Back</a>
</center>
</html>