forked from science-ation/science-ation
Restore query
This commit is contained in:
parent
b875e9a4a7
commit
9f49d4b35b
@ -137,6 +137,7 @@ if (get_value_from_array($_POST, 'action') == 'rollover' && get_value_from_array
|
||||
$q = $pdo->prepare("SELECT DATE_ADD(date,INTERVAL 365 DAY) AS newdate,name,description FROM dates WHERE year='$currentfairyear'");
|
||||
$q->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
$r->newdate = $r->newdate ?? "0000-00-00 00:00:00";
|
||||
while ($r = $q->fetch(PDO::FETCH_OBJ)) {
|
||||
$stmt = $pdo->prepare("INSERT INTO dates (date,name,description,year) VALUES (
|
||||
'" . $r->newdate . "',
|
||||
|
@ -123,8 +123,17 @@ function config_update_variables($fairyear = NULL, $lastfairyear = NULL)
|
||||
|
||||
$v = $r2->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$r3 = $pdo->prepare('INSERT INTO config (var,val,category,type,type_values,ord,description,year) VALUES (?,?,?,?,?,?,?,?)');
|
||||
$r3->execute([$pdo->quote($v['var']),$pdo->quote($v['val']),$pdo->quote($v['category']),$pdo->quote($v['type']),$pdo->quote($v['type_values']),$pdo->quote($v['ord']),$pdo->quote($v['description']),$fairyear]);
|
||||
$r3 = $pdo->prepare('INSERT INTO config (var,val,category,type,type_values,ord,description,year) VALUES (
|
||||
' . $pdo->quote($v['var']) . ',
|
||||
' . $pdo->quote($v['val']) . ',
|
||||
' . $pdo->quote($v['category']) . ',
|
||||
' . $pdo->quote($v['type']) . ',
|
||||
' . $pdo->quote($v['type_values']) . ',
|
||||
' . $pdo->quote($v['ord']) . ',
|
||||
' . $pdo->quote($v['description']) . ",
|
||||
'$fairyear')");
|
||||
|
||||
$r3->execute();
|
||||
show_pdo_errors_if_any($pdo);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user