Error : Trying to get property num_rows of non-object property in wampserver
-
i am trying to fetch the candidate exam details about exam from DB on wampserver and it is giving me this error,
( ! ) Notice: Trying to get property 'num_rows' of non-object in C:\wamp64\www\online-exam-portal\code\manage-exam\_export-to-csv.php on line 85
here is the code
" . $userID . "
";
//exit();// Fetch user responses to questions
$sql = "SELECT
'Multi-choice' AS exam_type,
mcq.question AS question_text,
mcq.correct_answer AS correct_answer,
mcqr.response AS chosen_option,
mcqr.score AS marks
FROM
multi_choice_question mcq
INNER JOIN multi_choice_response mcqr ON mcq.exam_id = mcqr.exam_id
AND mcq.question_no = mcqr.question_no
WHERE
mcqr.assignee_id = '$userID'
AND mcq.exam_id = $examIDUNION SELECT 'Fill in the blank' AS exam\_type, fiq.question AS question\_text, fir.response AS chosen\_option, fir.score AS marks FROM fill\_in\_question fiq INNER JOIN fill\_in\_response fir ON fiq.exam\_id = fir.exam\_id AND fiq.question\_no = fir.question\_no WHERE fir.assignee\_id = '$userID' AND fiq.exam\_id = $examID UNION SELECT 'Theory' AS exam\_type, tq.question AS question\_text, tr.response AS chosen\_option, tr.score AS marks FROM theory\_question tq INNER JOIN theory\_response tr ON tq.exam\_id = tr.exam\_id AND tq.question\_no
-
i am trying to fetch the candidate exam details about exam from DB on wampserver and it is giving me this error,
( ! ) Notice: Trying to get property 'num_rows' of non-object in C:\wamp64\www\online-exam-portal\code\manage-exam\_export-to-csv.php on line 85
here is the code
" . $userID . "
";
//exit();// Fetch user responses to questions
$sql = "SELECT
'Multi-choice' AS exam_type,
mcq.question AS question_text,
mcq.correct_answer AS correct_answer,
mcqr.response AS chosen_option,
mcqr.score AS marks
FROM
multi_choice_question mcq
INNER JOIN multi_choice_response mcqr ON mcq.exam_id = mcqr.exam_id
AND mcq.question_no = mcqr.question_no
WHERE
mcqr.assignee_id = '$userID'
AND mcq.exam_id = $examIDUNION SELECT 'Fill in the blank' AS exam\_type, fiq.question AS question\_text, fir.response AS chosen\_option, fir.score AS marks FROM fill\_in\_question fiq INNER JOIN fill\_in\_response fir ON fiq.exam\_id = fir.exam\_id AND fiq.question\_no = fir.question\_no WHERE fir.assignee\_id = '$userID' AND fiq.exam\_id = $examID UNION SELECT 'Theory' AS exam\_type, tq.question AS question\_text, tr.response AS chosen\_option, tr.score AS marks FROM theory\_question tq INNER JOIN theory\_response tr ON tq.exam\_id = tr.exam\_id AND tq.question\_no