Home>

We are creating something that registers the input contents in the database with PHP.
The error message is not displayed and it is "Registered".
When I look at the database, the updated contents are not reflected.

Error message

No error message is displayed, but the input is not registered in the database.

Applicable source code
database1.php
<html>
<head>
<meta http-equiv = "Content-Type" content = "text/html;charset = utf-8" />
<title>Assign assignment</title>
</head>
<body>
 New assignment registration 
        <form action = "database2.php" method = "POST">
        <p>No.</p>
        <input type = "text" name = "id" value = "" size = "50">
        <br>
        <table border = '1'>
        <tr>
            <th width = "100" nowrap>FY</th>
            <th width = "100" nowrap>Class</th>
            <th width = "100" nowrap>times</th>
            <th width = "100" nowrap>Type</th>
            <th width = "100" nowrap>Genre</th>
            <th width = "100" nowrap>Difficulty</th>
        </tr>
        <tr>
        <th width = "100" nowrap>
        <select name = "year">
            <option value = "2020">2020</option>
            <option value = "2019">2019</option>
            <option value = "2018">2018</option>
        </select>
        <th width = "100" nowrap>
        <select name = "class">
            <option value = "1">1</option>
            <option value = "2">2</option>
            <option value = "3">3</option>
            <option value = "4">4</option>
            <option value = "5">5</option>
            <option value = "6">6</option>
            <option value = "7">7</option>
            <option value = "8">8</option>
            <option value = "9">9</option>
        </select>
        <th width = "100" nowrap><select name = "number">
            <option value = "1st">1st</option>
            <option value = "2nd-3">2nd-3</option>
            <option value = "4-5">4-5</option>
            <option value = "6-7-7">6-7-7</option>
            <option value = "8-9">8-9</option>
            <option value = "10th">10th</option>
            <option value = "11th-12th">11th-12th</option>
            <option value = "13-14">13-14</option>
            <option value = "15th">15th</option>
        </select>
        <th width = "100" nowrap>
        <select name = "genre">
            <option value = "attendance assignment">attendance assignment</option>
            <option value = "Basic assignment">Basic assignment</option>
            <option value = "Development Issues">Development Issues</option>
        </select>
        <th width = "100" nowrap>
        <select name = "mso">
            <option value = "Word">Word</option>
            <option value = "Excel">Excel</option>
            <option value = "PowerPoint">PowerPoint</option>
            <option value = "Other">Other</option>
        </select>
        <th width = "100" nowrap>
        <select name = "level">
            <option value = "easy">easy</option>
            <option value = "Normal">Normal</option>
            <option value = "difficult">difficult</option>
        </select>
        </tr>
        </table>
        <p>Title of the assignment<br>
        <input type = "text" name = "practice" value = "" size = "50">
        <p>Deadline<br>
        <input type = "text" name = "time" value = "" size = "50">
        <p>Included content (target)<br>
        <input type = "text" name = "purpose" value = "" size = "200">
        <p>Samples and other points to consider<br>
        <input type = "text" name = "other" value = "" size = "200">
        <p>Agenda file<br>
        <input type = "text" name = "file" value = "" size = "50">
        <p><input type = "submit" value = "Register with the above contents"></p>
        </form>
</body>
</html>
database2.php
<html><head>
<meta http-equiv = "Content-Type" content = "text/html;charset = utf-8" />
<title>Assign assignment</title>
</head>
<body>
<? php
$con = mysqli_connect ('localhost', 'root', '2019minato');
if (! $con) {
  exit ('Could not connect to database');
}
$result = mysqli_select_db ($con, 'test');
if (! $result) {
  exit ('Database could not be selected');
}
$result = mysqli_query ($con, 'SET NAMES utf8');
if (! $result) {
  exit ('The character code could not be specified.');
}
$id = filter_input (INPUT_GET, 'id');
$year = filter_input (INPUT_GET, 'year');
$class = filter_input (INPUT_GET, 'class');
$number = filter_input (INPUT_GET, 'number');
$mso = filter_input (INPUT_GET, 'mso');
$genre = filter_input (INPUT_GET, 'genre');
$level = filter_input (INPUT_GET, 'level');
$practice = filter_input (INPUT_GET, 'practice');
$time = filter_input (INPUT_GET, 'time');
$purpose = filter_input (INPUT_GET, 'purpose');
$other = filter_input (INPUT_GET, 'other');
$file = filter_input (INPUT_GET, 'file');
$result = mysqli_query ($con, "INSERT INTO bank (id, year, class, number, mso, genre, level, practice, time, purpose, other, file) VALUES ('$id', '$year', ' $class', '$number', '$mso', '$genre', '$level', '$practice', '$time', '$purpose', '$other', '$file') " );
if (! $result) {
  exit ('Data could not be registered');
}
$con = mysqli_close ($con);
if (! $con) {
  exit ('Could not close connection with database');
}
?>
<p>Registration is complete.<br />Back</p>
</body>
</html>
But where for the

error does not appear is wrong I have unfortunately not know.

Supplemental information (FW/tool version etc.)

Please provide more detailed information here.