-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_options.php
More file actions
43 lines (31 loc) · 983 Bytes
/
update_options.php
File metadata and controls
43 lines (31 loc) · 983 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
include_once ('classes/Database.php');
include_once ('user/local.php');
# database options
$db = Database::getDB();
$mysqli = $db->getCon();
# line endings
if (php_sapi_name() == 'cli') {
$line_end = "\n";
} else {
$line_end = '<br>' . "\n";
}
# rename comment fields
$sql = 'ALTER TABLE `configuration`
CHANGE `option_value` `option_value` TEXT NOT NULL;';
$result = $mysqli->multi_query($sql);
if (!$result) {
echo '<pre>'; print_r($mysqli); echo '</pre>';
echo 'could not change fields in table configuration' . $line_end;
} else {
echo 'changed fields in table configuration' . $line_end;
}
$fields = array('option_set', 'option_name', 'option_value');
$values = array('sss', array('ext', 'google_adsense_ad', ''));
$id = $db->insert('configuration', $fields, $values);
if (!$id) {
echo 'could not insert option' . $line_end;
} else {
echo 'added option' . $line_end;
}
?>