Form submission process page

CODE (There is no display for this page)
<?php
//get the record in which the values will be updated
$record_id= $_GET['record_id'];
//get the values to place in the update statement
$variable1= $_POST['variable1'];
$variable2= $_POST['variable2'];
$variable3= $_POST['variable3'];
$variable4= $_POST['variable4'];
$variable5= $_POST['variable5'];
$variable6= $_POST['variable6'];
$variable7= $_POST['variable7'];
$variable8= $_POST['variable8'];
$variable9= $_POST['variable9'];
$variable10= $_POST['variable10'];
//set variables to connect to the database
$hostName = "(FILL IN HOSTNAME FOR DB)";
$userName = "(FILL IN USERNAME FOR DB)";
$password = "(FILL IN PASSWORD FOR DB)";
$dbName = "(FILL IN DB NAME)";
// make connection to database 
mysql_connect($hostName, $userName, $password) or die( "Unable to connect to host $hostName");
mysql_select_db($dbName) or die("Unable to select database $dbName");
//use select statement to get check if the record_id already exists in the table
$query_select = "SELECT * FROM (FILL IN TABLE NAME) WHERE record_id= '$record_id'";
$result_select = mysql_query($query_select);
//user the numrows command to see if a row exists
$number_select = mysql_numrows($result_select);
//use and if/else statment to either insert a new row or update an existing row
if($number_select)
{
// Insert a new row into the database table
	$query_insert = "INSERT INTO (FILL IN TABLE NAME) (field1, field2, field3, field4, field5, field6, field7, field8, field9, field10) VALUES ('$variable1','$variable2','$variable3','$variable4','$variable5','$variable6','$variable7','$variable8','$variable9','$variable10')";
	$result_insert = mysql_query($query_insert) /*or die(mysql_error())*/;//include the die statement to alert any errors in the query (remove /* and */ to uncomment)
}
else
{
// Update an existing row in the database table
	$query_update = "UPDATE (FILL IN TABLE NAME) SET field1='$variable1', field2='$variable2', field3='$variable3', field4='$variable4', field5='$variable5', field6='$variable6', field7='$variable7', field8='$variable8', field9='$variable9', field10='$variable10' WHERE record_id= '$record_id'";
	$result_update = mysql_query($query_update) /*or die(mysql_error())*/;//include the die statement to alert any errors in the query (remove /* and */ to uncomment)
}
// Close the database connection 
mysql_close();
//set up an if/else statement to check if all required values are set
//if all conditions are met, send the user to the next page
if($variable1!='' AND $variable2!='' AND $variable3!='' AND $variable4!='' AND $variable5!='' AND $variable6!='' AND $variable7!='' AND $variable8!='' AND $variable9!='' AND $variable10!='')
{
//use the header command to send the user to the next page
	header('Location: next_page.php?record_id='.$record_id);
}
//if not all conditions are met, return the user to the previous page to fill in the missing information
else
{
//use the header command to send the user to the previous page
	header('Location: previous_page.php?record_id='.$record_id);
}
?>