Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Site Bugs / Suggestions
  4. Error : Trying to get property num_rows of non-object property in wampserver

Error : Trying to get property num_rows of non-object property in wampserver

Scheduled Pinned Locked Moved Site Bugs / Suggestions
databasephphelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Blessing Banda
    wrote on last edited by
    #1

    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 = $examID

        UNION
    
        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
    
    L 1 Reply Last reply
    0
    • B Blessing Banda

      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 = $examID

          UNION
      
          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
      
      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Please read my reply to the poster of the question below: Re: WordPress database error: [You have an error in your SQL syntax;[^].

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups