<a href="index.php">Home page</a>
<?php 

// Connect to the database
require('db.php'); 

// Set username and password variables for this script
$customernum = mysql_real_escape_string($_POST['customernum']);
$select = mysql_real_escape_string($_POST['select']);
$code = mysql_real_escape_string($_POST['code']);
$errormsg = mysql_real_escape_string($_POST['errormsg']);


switch ($select) {
    case "acode":
        $sql = "INSERT INTO bill (`id`, `customernum`, `acode`, `icode`, `tcode`, `errormsg`) VALUES (NULL, '$customernum', '$code', '', '', '$errormsg')"; mysql_query($sql);
        break;
    case "icode":
        $sql = "INSERT INTO bill (`id`, `customernum`, `acode`, `icode`, `tcode`, `errormsg`) VALUES (NULL, '$customernum', '', '$code', '', '$errormsg')"; mysql_query($sql);
        break;
    case "tcode":
        $sql = "INSERT INTO bill (`id`, `customernum`, `acode`, `icode`, `tcode`, `errormsg`) VALUES (NULL, '$customernum', '', '', '$code', '$errormsg')"; mysql_query($sql);
        break;
    default:
       $sql = "INSERT INTO bill (`id`, `customernum`, `acode`, `icode`, `tcode`, `errormsg`) VALUES (NULL, '$customernum', '$code', '', '', '$errormsg')"; mysql_query($sql);
}
		 
echo "Account bill updated";

 
?>