title: Trying to query a multidimensional array with PHP
body: <pre><code>array(2) {
    [0]=&gt; Array(5) {
      ["aID"]=&gt;string(2) "18"
      ["asID"]=&gt;string(1) "5"
      ["msqID"]=&gt;string(2) "59"
      ["answer"]=&gt;string(3) "red"
      ["answerLong"]=&gt; string(0) "" 
    }
    [1]=&gt; Array(5) {
      ["aID"]=&gt;string(2) "22"
      ["asID"]=&gt;string(1) "6"
      ["msqID"]=&gt;string(2) "59"
      ["answer"]=&gt;string(3) "Green"
      ["answerLong"]=&gt; string(0) "" 
    }
  }
  </code></pre>
  
  <p>Have built a form for a client (Hospital) the purpose is for staff to be able to use this form to show the status of beds on the ward from Red, Amber, Yellow and Green. The idea being that when a member of staff chooses a colour and provides some other information the status will then be shown on other pages across the extranet... </p>
  
  <p>It has to be site wide, BUT not global as there are other departments/wards and their bed status will no doubt be different. </p>
  
  <p>Hopefully I've explained this right, what I need to do is get the value from the select input on the form (msqID) and store that value ["answer"] in a variable which I can then use elsewhere. Does this make sense?</p>
  
  <pre><code>$q  = "SELECT * FROM btFormAnswers WHERE msqID ='59' ";
  $r  = $db-&gt;getAll($q);
  foreach($r as $status) {
      foreach($status['0'] as $bedStatus) {
          echo $bedStatus['answer'];
      }
  }
  </code></pre>
  
  <p>Is what I have and I get error messages essentially.</p>