forked from science-ation/science-ation
Ensure PDO is defined
This commit is contained in:
parent
81299494c5
commit
4f935e5818
@ -169,6 +169,8 @@ function questions_parse_from_http_headers($array_name)
|
||||
|
||||
function questions_update_question($qs)
|
||||
{
|
||||
global $pdo;
|
||||
$qs['ord'] = $qs['ord'] ?? '';
|
||||
$stmt = $pdo->prepare("UPDATE questions SET
|
||||
`question`='".$qs['question']."',
|
||||
`type`='".$qs['type']."',
|
||||
@ -181,7 +183,8 @@ function questions_update_question($qs)
|
||||
}
|
||||
|
||||
function questions_save_new_question($qs, $year)
|
||||
{ global $pdo;
|
||||
{
|
||||
global $pdo;
|
||||
$stmt = $pdo->prepare("INSERT INTO questions ".
|
||||
"(question,type,section,db_heading,required,ord,year) VALUES (".
|
||||
"'".$qs['question']."',".
|
||||
@ -206,8 +209,7 @@ function questions_save_new_question($qs, $year)
|
||||
* all elements */
|
||||
function questions_editor($section, $year, $array_name, $self)
|
||||
{
|
||||
global $config;
|
||||
global $pdo;
|
||||
global $config, $pdo;
|
||||
if(get_value_from_array($_POST, 'action') == "save") {
|
||||
|
||||
$qs = questions_parse_from_http_headers('question');
|
||||
|
Loading…
x
Reference in New Issue
Block a user