diff options
| author | Andreas Fischer <bantu@phpbb.com> | 2010-10-25 21:54:49 +0200 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2010-10-25 21:54:49 +0200 |
| commit | 52546e8d15bf901baa3bd527d87129afd282cb2b (patch) | |
| tree | 700d94e0e3a6a46ab0c674b1dd901d5605103630 /phpBB/includes/db | |
| parent | a5bc7c90f552a65410a2b3abe05278346df387e5 (diff) | |
| parent | 5c5b0fc4beeb51288e3ec83f6b253f1d4134f50d (diff) | |
| download | forums-52546e8d15bf901baa3bd527d87129afd282cb2b.tar forums-52546e8d15bf901baa3bd527d87129afd282cb2b.tar.gz forums-52546e8d15bf901baa3bd527d87129afd282cb2b.tar.bz2 forums-52546e8d15bf901baa3bd527d87129afd282cb2b.tar.xz forums-52546e8d15bf901baa3bd527d87129afd282cb2b.zip | |
Merge branch 'ticket/naderman/9686' into develop-olympus
* ticket/naderman/9686:
[ticket/9686] Fix mssqlnative database data export
Diffstat (limited to 'phpBB/includes/db')
| -rw-r--r-- | phpBB/includes/db/mssqlnative.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php index 44d5722e4f..d6ac3b3acc 100644 --- a/phpBB/includes/db/mssqlnative.php +++ b/phpBB/includes/db/mssqlnative.php @@ -51,7 +51,6 @@ class result_mssqlnative } $this->m_row_count = count($this->m_rows); - sqlsrv_free_stmt($queryresult); } private function array_to_obj($array, &$obj) @@ -199,6 +198,7 @@ class dbal_mssqlnative extends dbal { var $m_insert_id = NULL; var $last_query_text = ''; + var $query_options = array(); /** * Connect to server @@ -308,10 +308,12 @@ class dbal_mssqlnative extends dbal if ($this->query_result === false) { - if (($this->query_result = @sqlsrv_query($this->db_connect_id, $query)) === false) + if (($this->query_result = @sqlsrv_query($this->db_connect_id, $query, array(), $this->query_options)) === false) { $this->sql_error($query); } + // reset options for next query + $this->query_options = array(); if (defined('DEBUG_EXTRA')) { @@ -598,20 +600,28 @@ class dbal_mssqlnative extends dbal * Utility method used to retrieve number of rows * Emulates mysql_num_rows * Used in acp_database.php -> write_data_mssqlnative() + * Requires a static or keyset cursor to be definde via + * mssqlnative_set_query_options() */ function mssqlnative_num_rows($res) { if ($res !== false) { - $row = new result_mssqlnative($res); - $num_rows = $row->num_rows(); - return $num_rows; + return sqlsrv_num_rows($res); } else { return false; } } + + /** + * Allows setting mssqlnative specific query options passed to sqlsrv_query as 4th parameter. + */ + function mssqlnative_set_query_options($options) + { + $this->query_options = $options; + } } ?>
\ No newline at end of file |
