I did two things:
First thing:
$query = "insert into surplus values('$type','$year','$specs',NULL)";
I added NULL as value for field "id". If NULL is defined the value increments automatically.
Alternatively you could define your insert statement without defining a, "id" value:
$query = "insert into surplus (type,year,specs) values('$type','$year','$specs')";
// or
$query = "insert into surplus (year,type,specs) values('$year','$type','$specs')";
Second thing:
$result = mysql_query($query)
or print ">>> MySQL-Error: ".mysql_errno()." -> ".mysql_error()."<br>\n";
I added a "or print" - statement, to get some sql errors codes and messages in the case of sql some error.