-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathposted_data.php
More file actions
62 lines (42 loc) · 1.51 KB
/
posted_data.php
File metadata and controls
62 lines (42 loc) · 1.51 KB
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
<?php
include 'connectdb.php';
$type = $_GET['type'];
// if($type == "display"){
// $name = $_GET['name'];
// $mobile = $_GET['mobile'];
// $email = $_GET['email'];
// $title = $_GET['title'];
// $message = $_GET['message'];
// $districts = $_GET['districts'];
// $sql = "INSERT INTO meeting_info (name, mobile, email, title, message, districts)
// VALUES ('$name', '$mobile', '$email', '$title', '$message', '$districts');";
// if ($conn->query($sql) === TRUE) {
// echo "New records created successfully";
// } else {
// echo "Error: " . $sql . "<br>" . $conn->error;
// }
// }
if ($type == "search") {
$selected_district = $_GET['selected_district'];
$sql1 = "SELECT * FROM meetings_info where districts = '$selected_district'";
$res_cmpy1 = $conn->query($sql1);
if ($res_cmpy1->num_rows > 0) {
$i = 0;
while($row1 = $res_cmpy1->fetch_assoc()) {
$output['name'] = $row1['name'];
$output['mobile'] = $row1['mobile'];
$output['email'] = $row1['email'];
$output['title'] = $row1['title'];
$output['message'] = $row1['message'];
$output['districts'] = $row1['districts'];
$output['image'] = base64_encode($row1['image']);
$data['records'][] = $output;
}
} else {
$output['value'] = "0";
$data['records'][] = $output;
}
echo json_encode($data,true);
}
$conn->close();
?>