title: Magento: Get simple product color from custom table
body: <p>I'm really struggling with this in Magento 1.10 Enterprise. I have a array of simple products color ids and I want to use this id to query the atb_color table. Raw query:</p>
  
  <pre><code>SELECT description FROM atb_colors WHERE option_id = 'my_color_id'
  </code></pre>
  
  <p>Here is a method I was trying to build:</p>
  
  <pre><code>public function getColorData($product){ 
      $ids = $product-&gt;getTypeInstance()-&gt;getUsedProductIds();    
      foreach($ids as $id){
          $simpleproduct = Mage::getModel('catalog/product')-&gt;load($id);
                      --&gt;Query using my_color_id
  
      }       
  }
  </code></pre>
  
  <p>I can use this to get name and quantity. If I put this in the foreach loop:</p>
  
  <pre><code>echo $simpleproduct-&gt;getName()." - ".(int)Mage::getModel('cataloginventory/stock_item')-&gt;loadByProduct($simpleproduct)-&gt;getQty() . '&lt;br /&gt;';
  </code></pre>
  
  <p>How would I run this query. Forgive me I am very new to Magento. It's somewhat difficult to grasp some of it. But I'm on a deadline to finish this one section of displaying color and size. Any help? Please, please!!</p>
  
  <p>Thanks in advance</p>