title: PHP get value of one column in array
body: <p>I'm writing some data off my MySQL database into an array using columns with php like this: </p>
  
  <pre><code>    if ($result-&gt;num_rows &gt; 0) {
          while($row = $result-&gt;fetch_assoc()) {
              $row-&gt;id = $row["ID"];
              $row-&gt;product = $row["product"];
              $row-&gt;aantal = $row["Aantal"];
              $row-&gt;price = $row["Price"];
              $od[] = $row;
      }
      } else {
         echo "0 results";
      }
  </code></pre>
  
  <p>now later I have to use the $row->id and $row->product of the different columns seperatly to get some more data out of another table in MySQL. I've been trying to accomplish this: </p>
  
  <pre><code>$to = 0;
  foreach($od as $odt)
  {
      $odb= $odt[$to]["ID"];
      $sql = "SELECT `Name` FROM `detail` WHERE `ID` = '$odb'";
      $to++;
  </code></pre>
  
  <p>But this doesn't seem to work, I've tried dozen of others but can't seem to get this thing right...</p>
  
  <p>Any solutions or remarks?</p>
  
  <p>EDIT:
  Array ( [0] => Array ( [ID] => 3 [product] => 10 [Aantal] => 1 [Price] => 3 ) [1] => Array ( [ID] => 4 [product] => 13 [Aantal] => 1 [Price] => 3 ) [2] => Array ( [ID] => 5 [product] => 3 [Aantal] => 3 [Price] => 4 ) ) </p>