title: Unable to connect from PHP Azure to SQL Server Azure using PHP with Codeigniter
body: <p>I am trying to connect from a php app (using codeigniter 3) to a MSSQL database.</p>
  
  <p>As the Azure PHP installation does not support MSSQL, only ODBC connections (I wonder why) my connection parameter look like this: (hostname, username, database and passwords in this sample overridden with xxxxx,ddddd,uuuuu,ppppp)</p>
  
  <pre><code>$db['default'] = array(
      'dsn'   =&gt; @$_SERVER['SQLAZURECONNSTR_ddddd'],
      'hostname' =&gt; 'Driver={SQL Server};tcp:xxxxx.database.windows.net,1433;Database=ddddd',
      'username' =&gt; 'uuuuuu',
      'password' =&gt; 'pppppp',
      'database' =&gt; 'ddddd',
      'dbdriver' =&gt; 'odbc',
      'dbprefix' =&gt; '',
      'pconnect' =&gt; FALSE,
      'db_debug' =&gt; TRUE,
      'cache_on' =&gt; FALSE,
      'cachedir' =&gt; '',
      'char_set' =&gt; 'utf8',
      'dbcollat' =&gt; 'utf8_general_ci',
      'swap_pre' =&gt; '',
      'autoinit' =&gt; TRUE,
      'stricton' =&gt; FALSE,
      'failover' =&gt; array(),
      'save_queries' =&gt; TRUE
  );
  </code></pre>
  
  <p>But I am getting the following error:</p>
  
  <blockquote>
    <p>Message: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data > source name not found and no default driver specified, SQL state IM002 in > SQLConnect</p>
    
    <p>Filename: odbc/odbc_driver.php</p>
  </blockquote>
  
  <p>I would have assumed that the azure php odbc driver would be correctly configured to connect to its linked mssql database. - But I am obviously missing something.</p>