-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject.php
More file actions
37 lines (26 loc) · 1.04 KB
/
object.php
File metadata and controls
37 lines (26 loc) · 1.04 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
<?php
/*phpinfo();*/
$objectString = $_GET['objects'];
$connect = pg_connect("host=brain.isi.edu port=5432 dbname=drdata user=drreader password=drspr2013cbg") or die(pg_last_error());
$splitArray = spliti(",", $objectString);
error_log(print_r($splitArray,true));
$whereQuery = '';
$firstIteration = true;
foreach ($splitArray as $value) {
if($firstIteration){
$firstIteration = false;
}else{
$whereQuery = $whereQuery . " or ";
}
//$whereQuery = $whereQuery . "t.object_id = " . $value;
$whereQuery = $whereQuery . "t.user_id = " . $value;
}
//$query = 'select t.object_id, t.timestamp_without_tz, t.object_position_x, t.object_position_y from ak_spatiotemporal_data_table t where' . ' ' . $whereQuery;
$query = 'select t.user_id, t.std_timestamp, t.latitude, t.longitude from twitter_spatiotemporal_data_table t where' . ' ' . $whereQuery;
error_log(print_r($query,true));
$result = pg_query($connect, $query);
$resultArray = pg_fetch_all($result);
$json = json_encode($resultArray);
error_log(print_r($json,true));
print $json;
?>