forked from crocos/php-treasure-data
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathall.php
More file actions
29 lines (25 loc) · 617 Bytes
/
all.php
File metadata and controls
29 lines (25 loc) · 617 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
<?php
/**
*
*/
require_once __DIR__ . '/example.inc.php';
try {
// if specify apikey ::
// $td = new \TreasureData\API('test_db', $api_key);
$td = new \TreasureData\API('test_db');
$td->setDebug(true);
$job_id = $td->job->issue(
"SELECT count(*) FROM test WHERE v['action'] = 'login'"
);
while (1) {
$res = $td->job->show($job_id);
if ($res->status == 'success') {
break;
}
sleep(1);
}
$res = $td->job->result($job_id);
echo $res, PHP_EOL;
} catch (\TreasureData\Exception $e) {
echo $e->getMessage(), PHP_EOL;
}