/**
  * Select database
  *
  * @param   string db name of database to select
  * @return  bool success
  * @throws  rdbms.SQLStatementFailedException
  */
 public function selectdb($db)
 {
     if (!sqlsrv_select_db($db, $this->handle)) {
         throw new SQLStatementFailedException('Cannot select database: ' . $this->errors(), 'use ' . $db, current(sqlsrv_fetch_row(sqlsrv_query('select @@error', $this->handle))));
     }
     return TRUE;
 }
예제 #2
0
 /**
  * get one row from resultset
  * @return array
  */
 function fetch_row($query)
 {
     return sqlsrv_fetch_row($query);
 }