forked from kamba4/sunders
first changes for sync of instances
Some checks failed
images.yml / first changes for sync of instances (push) Failing after 0s
Some checks failed
images.yml / first changes for sync of instances (push) Failing after 0s
This commit is contained in:
parent
82b41342fc
commit
ea2d8ebe37
2 changed files with 99 additions and 0 deletions
27
web/www/sunders/sync-state.php
Normal file
27
web/www/sunders/sync-state.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
error_reporting(0);
|
||||
include $pathToWebFolder.'config.php';
|
||||
|
||||
|
||||
/* Connect to database */
|
||||
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB);
|
||||
if($mysqli->connect_errno) {
|
||||
header('Content-type: application/json');
|
||||
$result = '{"error":"error while connecting to db : ' . $mysqli->error . '"}';
|
||||
echo $result;
|
||||
exit;
|
||||
}
|
||||
|
||||
$syncstate_querry = $mysqli->query("SELECT * FROM sync_state WHERE k = 'sequenceNumber'");
|
||||
|
||||
while($row = $syncstate_querry->fetch_assoc()) {
|
||||
$syncstate = array('sequenceNumber' => $row["v"]);
|
||||
}
|
||||
|
||||
$result = json_encode($syncstate);
|
||||
|
||||
$mysqli->close();
|
||||
|
||||
header('Content-type: application/json; Charset : utf-8');
|
||||
echo $result;
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue