-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddbus1.php
More file actions
35 lines (30 loc) · 847 Bytes
/
Copy pathaddbus1.php
File metadata and controls
35 lines (30 loc) · 847 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>
</title>
</head>
<body>
<?php
$hostname = "localhost";
$username = "root";
$password = "";
$con = mysql_connect($hostname, $username, $password) ;
if (!$con){ die('Could not connect: '. mysql_error());}
$dbName="delhimetro";
$db = mysql_select_db($dbName,$con);
$sql="INSERT INTO bus
VALUES ('$_POST[bus_no]',
'$_POST[engine_number]',
'$_POST[tyre_company]',
'$_POST[driver_name]',
'$_POST[conductor_name]')";
if (!mysql_query($sql,$con))die('Error: ' . mysql_error());
echo "1 record added";
mysql_close($con)
?>
<script type="text/javascript">
window.location.href = "addbus.php";
</script>
</body>
</html>