diff options
author | Andreas Fischer <bantu@phpbb.com> | 2013-11-03 18:09:44 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2013-11-03 18:09:44 +0100 |
commit | e02836b19caa96828ae19af4ecd4278f3556f6fd (patch) | |
tree | aa369fca66212e18af4840461fd932b688880882 /phpBB | |
parent | 478d4971a673c96dafb8dce7e149d235c0da6aad (diff) | |
parent | ad44407b19daaa861e91b75c2c40ae4655121e7f (diff) | |
download | forums-e02836b19caa96828ae19af4ecd4278f3556f6fd.tar forums-e02836b19caa96828ae19af4ecd4278f3556f6fd.tar.gz forums-e02836b19caa96828ae19af4ecd4278f3556f6fd.tar.bz2 forums-e02836b19caa96828ae19af4ecd4278f3556f6fd.tar.xz forums-e02836b19caa96828ae19af4ecd4278f3556f6fd.zip |
Merge remote-tracking branch 'Noxwizard/ticket/11990' into develop
* Noxwizard/ticket/11990:
[ticket/11990] Remove result_mssqlnative usage in acp_database.php
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/acp/acp_database.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 86879de816..8afc3709b9 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -1607,16 +1607,17 @@ class mssql_extractor extends base_extractor return; } - $sql = "SELECT * FROM $table_name"; - $result_fields = $db->sql_query_limit($sql, 1); - - $row = new result_mssqlnative($result_fields); - $i_num_fields = $row->num_fields(); + $sql = "SELECT COLUMN_NAME, DATA_TYPE + FROM INFORMATION_SCHEMA.COLUMNS + WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = '" . $db->sql_escape($table_name) . "'"; + $result_fields = $db->sql_query($sql); - for ($i = 0; $i < $i_num_fields; $i++) + $i_num_fields = 0; + while ($row = $db->sql_fetchrow($result_fields)) { - $ary_type[$i] = $row->field_type($i); - $ary_name[$i] = $row->field_name($i); + $ary_type[$i_num_fields] = $row['DATA_TYPE']; + $ary_name[$i_num_fields] = $row['COLUMN_NAME']; + $i_num_fields++; } $db->sql_freeresult($result_fields); |