php form not reading from database

Solutions on MaxInterview for php form not reading from database by the best coders in the world

showing results for - "php form not reading from database"
Helen
01 Jan 2019
1<?php
2
3// Get the assignment data
4$proj_id = filter_input(INPUT_POST, 'proj_id');
5$ass_num = filter_input(INPUT_POST, 'ass_num', FILTER_VALIDATE_INT);
6$charge = filter_input(INPUT_POST, 'charge', FILTER_VALIDATE_FLOAT);
7$chg_hr = filter_input(INPUT_POST, 'chg_hr', FILTER_VALIDATE_FLOAT);
8$ass_date = filter_input(INPUT_POST, 'ass_date');
9$hours = filter_input(INPUT_POST, 'hours', FILTER_VALIDATE_FLOAT);
10$job = filter_input(INPUT_POST, 'job');
11$emp_num = filter_input(INPUT_POST, 'emp_num');
12
13// Validate inputs
14if ($ass_num == false || $ass_num == null || $proj_id == null ||
15        $charge == null || $charge == false ||$chg_hr == null || $chg_hr == false || $ass_date == null || $hours == null || $hours == false ||$job == null || $emp_num == null) {
16    $error = "Invalid assignment data. Check all fields and try again.";
17    include('error.php');
18} 
19else 
20{
21   require_once('repository_inc.php');
22    // Add an assignment to the database  
23    add_assignment($ass_num,$charge, $chg_hr, $ass_date, $hours, $job, $emp_num, $proj_id);
24    // Display the Project List page
25    include('index.php');
26}
27?>