Ensure PDO is defined

This commit is contained in:
Armanveer Gill 2025-01-28 14:34:42 -05:00
parent 81299494c5
commit 4f935e5818

View File

@ -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');