-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhoswho.php
36 lines (28 loc) · 912 Bytes
/
whoswho.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
<?php
$con = mysqli_connect("50.62.209.47","dbddbadmin","Dbddemo@3579","dbddemo");
if(mysqli_connect_errno($con)){
echo "Failed to connect ".mysqli_connect_error();
}
$page = $_GET['page'];
$n = $page*6;
$result = mysqli_query($con,"SELECT id,wTitle,wNameFirst,wNameLast,wImgFile FROM whoswho WHERE pStatus='RECEIVED' ORDER BY wNameFirst LIMIT $n,6");
$json = array();
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
// echo "wTitle: " . $row["wTitle"]. " - Name: " . $row["wNameFirst"]. " ". $row["wNameLast"] ."<br>";
$json[] = array(
'title' => $row['wTitle'],
'firstname' => $row['wNameFirst'],
'lastname' =>$row['wNameLast'],
'id' =>$row['id'],
'image' =>$row['wImgFile']
);
}
} else {
echo "0 results";
}
$jsonstring = json_encode($json);
echo $jsonstring;
mysqli_close($con);
?>