-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdemo5.php
104 lines (95 loc) · 1.9 KB
/
demo5.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<style type="text/css">
table{
border:1px solid black;
}
td{
border:1px solid black;
}
body{
font-size: 2em;
}
.m1{
margin-left: 40%;
float: left;
position: absolute;
left: 10px;
top: 50px;
}
div{
position: absolute;
left: 500px;
top: 0px;
}
</style>
<?php
$conn = mysqli_connect("localhost", "root", "", "state");
$link=pg_connect("host=localhost port=5432 dbname=demo user=postgres password=1234");
$fr=$_POST["fragment"];
$q="SELECT * FROM state where city='$fr'";
$sql=mysqli_query($conn,$q);
echo "<span>Delivery assignments for $fr</span>";?>
<table>
<?php
while($row=mysqli_fetch_assoc($sql)){
echo" <tr>";
echo" <td>";
echo $row['code'];
echo" </td>";
echo" <td>";
echo $row['city'];
echo" </td>";
echo" <td>";
echo $row['delivery'];
echo" </td>";
echo" </tr>";
}
$sql=pg_query($q);
while($row=pg_fetch_assoc($sql)){
echo" <tr>";
echo" <td>";
echo $row['code'];
echo" </td>";
echo" <td>";
echo $row['city'];
echo" </td>";
echo" <td>";
echo $row['delivery'];
echo" </td>";
echo" </tr>";
}?>
</table>
<?php
$q="SELECT * FROM state where city!='$fr'";
$sql=mysqli_query($conn,$q);
echo "<div>Delivery assignments for other than $fr</div>";?>
<table class="m1">
<?php
while($row=mysqli_fetch_assoc($sql)){
echo" <tr>";
echo" <td>";
echo $row['code'];
echo" </td>";
echo" <td>";
echo $row['city'];
echo" </td>";
echo" <td>";
echo $row['delivery'];
echo" </td>";
echo" </tr>";
}
$sql=pg_query($q);
while($row=pg_fetch_assoc($sql)){
echo" <tr>";
echo" <td>";
echo $row['code'];
echo" </td>";
echo" <td>";
echo $row['city'];
echo" </td>";
echo" <td>";
echo $row['delivery'];
echo" </td>";
echo" </tr>";
}?>
</table>