Get specific field from a table with moodle Data manipulation API
<p>I want to select all records from moodle data base where id is equal to a certain variable.Can anybody tell me what will be the moodle Data manipulation API syntax for it.</p>

<p>Here is <strong>mysql query</strong></p>

<pre><code>Select question from mdl_answers where id=$questionid;
</code></pre>

<p>I have tried</p>

<pre><code>$queid[]= $queid[] = $DB-&gt;get_field('question_answers', 'id', array('question' =&gt; $questionid), MUST_EXIST);
$true=$queid[0];   // this i get
$false=$queid[1];   //this remains empty
</code></pre>

<p>But it only gives one record whereas i have more than one records assosiated to this id.</p>

<p>as you can see in the picture record 71 and 72 have same value 48 in next column i want to get these ids 71 and 72
<a href="https://i.stack.imgur.com/z5H1t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z5H1t.png" alt="enter image description here"></a></p>