-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddHallphp.php
More file actions
45 lines (26 loc) · 779 Bytes
/
AddHallphp.php
File metadata and controls
45 lines (26 loc) · 779 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
36
37
38
39
40
41
42
43
44
45
<html>
<head>
</head>
<?php
$HallName =$_POST["HallName"];
$NumberOfSeats=$_POST["NumberOfSeats"];
$SeatsPerRow=$_POST["SeatsPerRow"];
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('could not connect: '.mysql_error());
}
mysql_select_db("opera",$con);
$q="insert into `hall` (`hname`,`seats`,`hrows`) values('".$HallName."',".$NumberOfSeats.",".$SeatsPerRow.")" ;
$c=mysql_query($q,$con);
for($i=1;$i<=$NumberOfSeats;$i++)
{
$q="insert into `seat` (`sno`,`hnumber`) select ".$i.", hno from hall where hname='".$HallName."'";
$c=mysql_query($q,$con);
}
echo '<script type="text/javascript">
window.onload=function() {alert("Successfuly inserted")}
</script>';
echo"<script>setTimeout(\"location.href = 'AddHall.php';\",0);</script>";
?>
</html>