-
Notifications
You must be signed in to change notification settings - Fork 4
/
insertSeveralContainers.php
60 lines (37 loc) · 1.28 KB
/
insertSeveralContainers.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
include('inc/init.php');
ini_set('max_execution_time', 300);
$log = new Logging();
$log->file($logFile);
$mysqli = new mysqli($sourceConfig['db_host'], $sourceConfig['db_user_name'], $sourceConfig['db_password'], $sourceConfig['db_name']);
if ($mysqli->connect_error) {
die('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);
}
if ($dbContent = $mysqli->query($mysqlQueryManyRows))
{
$dropScript = '';
while($row = mysqli_fetch_array($dbContent))
{
$containerInfo = extractRowData($row);
$query = htmlspecialchars_decode($ttlPrefixes) . ' INSERT DATA { GRAPH ' . $containerInfo[0][0] . ' { ' . $containerInfo[1][0] . '}}';
echo htmlspecialchars($query);
sparqlLoad($query);
$dropScript .= $containerInfo[2];
echo htmlspecialchars('; ; ; ; ;' . $dropScript);
// query drop emergency
//$i++;
}
$fileHandle = fopen($curlDropFile, 'w') or die("can't open file");
fwrite($fileHandle, $dropScript);
fclose($fileHandle);
//echo '<pre>';
// print_r($dbContent);
//echo '</pre>';
//displayDropEmergencyContainers($dbContent);
}
else
{
$log->write("Data base connection error: $mysqli->error");
$log->close();
}
?>