-
Notifications
You must be signed in to change notification settings - Fork 1
/
process-newform.php
47 lines (40 loc) · 1013 Bytes
/
process-newform.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
$Bus_id=$_POST["Bus_id"];
$Train_id=$_POST["Train_id"];
$Train_Name=$_POST["Train_Name"];
$Bus_Name=$_POST["Bus_Name"];
$Date=$_POST["Date"];
$Time=$_POST["Time"];
$No_of_Seats=$_POST["No_of_Seats"];
$From_W=$_POST["From_W"];
$To_W=$_POST["To_W"];
$host="localhost";
$dbname="urbanway";
$username="root";
$password="";
$conn=mysqli_connect(hostname:$host,
username:$username,
password:$password,
database:$dbname);
if (mysqli_connect_errno()) {
die("Connection error:". mysqli_connect_error());
}
$sql="INSERT INTO shedule (Bus_id,Train_id,Train_Name,Bus_Name,Date,Time,No_of_Seats,From_W,To_W)
VALUES(?,?,?,?,?,?,?,?,?)";
$stmt = mysqli_stmt_init($conn);
if( ! mysqli_stmt_prepare($stmt,$sql)){
die(mysqli_error($conn));
}
mysqli_stmt_bind_param($stmt,"iissssiss",
$Bus_id,
$Train_id,
$Train_Name,
$Bus_Name,
$Date,
$Time,
$No_of_Seats,
$From_W,
$To_W);
mysqli_stmt_execute($stmt);
echo"Record Saved";
?>