-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson_select.php
More file actions
34 lines (30 loc) · 788 Bytes
/
json_select.php
File metadata and controls
34 lines (30 loc) · 788 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
<?php
require_once __DIR__.'/../../includes/ajax-session-check.php';
$customer_group_id = $_GET['customer_group_id'];
$customer_aadhar_no = $_GET['aadhar_no'];
// customer_master cm
$sql = "SELECT
cm.customer_id,
cm.customer_name,
cm.customer_aadhar_no
FROM customer_master cm
WHERE cm.customer_group_id = '{$customer_group_id}'
AND cm.customer_aadhar_no LIKE '{$customer_aadhar_no}%'
LIMIT 5";
// echo $sql;
// die();
if(mysqli_query($dbcon, $sql)) {
$result = mysqli_query($dbcon, $sql);
if(mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)){
$cm[] = $row;
}
mysqli_free_result($result);
} else {
// echo 'No result found';
$cm = [];
}
echo json_encode($cm);
} else {
echo 'Error: '.mysqli_error($dbcon);
}