-
Notifications
You must be signed in to change notification settings - Fork 0
/
project_val.php
32 lines (22 loc) · 896 Bytes
/
project_val.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
include "connection.php";
$project_manager = $_POST["project_manager"];
$pname = $_POST["pname"];
$cname = $_POST["cname"];
$client_mail_id = $_POST["clnt_mail_id"];
$client_number = $_POST["clnt_number"];
$start_date = $_POST["start_date"];
$end_date = $_POST["end_date"];
$project_id = 0;
$sql = "SELECT * FROM project";
$result = $conn->query($sql);
$count = 0;
$project_id = ($result->num_rows) + 1;
$sql = "INSERT INTO project (project_id, project_name,project_manager,client_name,client_mail_id,client_number,start_date,end_date) VALUES ('" . $project_id . "','" . $pname . "', '" . $project_manager . "','" . $cname . "','" . $client_mail_id . "','" . $client_number . "', '" . $start_date . "', '" . $end_date . "')";
if (mysqli_query($conn, $sql)) {
echo "New record created successfully.";
} else {
echo "fail" . mysqli_error($conn);
}
mysqli_close($conn);
?>