summaryrefslogtreecommitdiff
path: root/includes/pages/user_questions.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/pages/user_questions.php')
-rw-r--r--includes/pages/user_questions.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/includes/pages/user_questions.php b/includes/pages/user_questions.php
index 20f82eb1..41fbe64d 100644
--- a/includes/pages/user_questions.php
+++ b/includes/pages/user_questions.php
@@ -43,15 +43,13 @@ function user_questions()
case 'ask':
$question = strip_request_item_nl('question');
if ($question != '') {
- $result = DB::insert('
+ DB::insert('
INSERT INTO `Questions` (`UID`, `Question`)
VALUES (?, ?)
',
[$user['UID'], $question]
);
- if (!$result) {
- engelsystem_error(_('Unable to save question.'));
- }
+
success(_('You question was saved.'));
redirect(page_link_to('user_questions'));
} else {
@@ -67,11 +65,11 @@ function user_questions()
return error(_('Incomplete call, missing Question ID.'), true);
}
- $question = DB::select(
+ $question = DB::selectOne(
'SELECT `UID` FROM `Questions` WHERE `QID`=? LIMIT 1',
[$question_id]
);
- if (count($question) > 0 && $question[0]['UID'] == $user['UID']) {
+ if (!empty($question) && $question['UID'] == $user['UID']) {
DB::delete(
'DELETE FROM `Questions` WHERE `QID`=? LIMIT 1',
[$question_id]