title: How to call a different database in Magento to fill a custom dropdown box?
body: <p>I am extremely new to Magento and I am not sure if what I want is possible. What I am trying to do is not to use the Magento API as we are using a multisite version of enterprise and it is extremely slow. I am currently using Magento version 1.11.</p>
  
  <p>I have a custom module that a previous employee made and I want to add a drop down box for it, have it call a different database (then the one that is setup in the local.xml file) and populate the box on a sql command to get all the Brands from the different database. The different database is a SQL database and not a MySQL database. I know the connection works as I have tested it and when I put </p>
  
  <pre><code>mssql_select_db('myDatabase', $link)
  die('Something went wrong')
  </code></pre>
  
  <p>it crashes; however, when I put the code like:</p>
  
  <pre><code>!mssql_select_db('myDatabase', $link)
  die('Something went wrong')
  </code></pre>
  
  <p>it doesn't crash it continues normally.</p>
  
  <p>My SQL code looks like this:</p>
  
  <pre><code>$getBrandNameQuery = "SELECT a.BrandID, a.[Name]
  FROM mydatabase a
  join Categories b on a.CategoryID = b.CategoryID
  where a.CategoryID = 1
  </code></pre>
  
  <p>This will give me the brands that I want. Now my php Magento code (though it just gives me a blank page) looks like this:</p>
  
  <pre><code>$fieldset-&gt;addField("get_brand", "select", array("label"=&gt; $helper-&gt;__("Brands"),
  "title"=&gt;$helper-&gt;__("Brands"),
  "name"=&gt;"get_brand",
  "required" =&gt; true,
  /*"values"=&gt; array(
  "1" =&gt; $helper-&gt;__("Active"),
  "0" =&gt; $helper-&gt;__("Inactive"),*/
  "values"=&gt; Mage::getSingleton("torus_mailinrebate_block_adminhtml_model_system_config_source_brands")-&gt;toOptionArray(),
  </code></pre>
  
  <p>And it doesn't send anything back or populate the drop box. The previous values were 0 and 1 for active and inactive but I am going to have about 30+ items.</p>
  
  <p>My code for getting the data looks like this:</p>
  
  <pre><code>for ($i = 0; $i &lt; mssql_num_rows($query); ++$i) {
  $row = mssql_fetch_row(mssql_query($getBrandNameQuery));
  $id = $row-&gt;getId();
  $name = $row-&gt;getName();
  $brandName[] = array('value'=&gt;$id, 'label'=&gt;$name);
  }
  
  mssql_free_result($query);
  return $brandName;
  </code></pre>
  
  <p>Please tell me where I need to start and any help would be highly appreciated.
  Thanks.</p>