-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLHASA.php
More file actions
23 lines (22 loc) · 722 Bytes
/
Copy pathLHASA.php
File metadata and controls
23 lines (22 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
require_once('connect.php');
$page = isset($_GET['page'])?(int)$_GET['page']:0;
$num = isset($_GET['requestNum'])?(int)$_GET['requestNum']:5;
$city = isset($_GET['city'])?$_GET['city']:'SYDNEY';
$startNum =$page*$num;
$sql = "select * from pic,pich where pic.ID=pich.ID and pic.CITY='$city' limit $startNum,$num";
$query = mysql_query($sql);
if($query&&mysql_num_rows($query)){
while($row = mysql_fetch_assoc($query)){
$data[] = $row;
}
}
$sql = "select * from tale where tale.CITY='$city' order by ID desc limit $startNum,$num";
$query = mysql_query($sql);
if($query&&mysql_num_rows($query)){
while($row = mysql_fetch_assoc($query)){
$data[] = $row;
}
}
echo json_encode($data);
?>