Added function 'db_get_fields' and the code for mysql

This commit is contained in:
mdtrooper 2014-09-09 15:22:31 +02:00
parent f3ddb0ec2f
commit a3bc8a4e0d
3 changed files with 25 additions and 1 deletions

View File

@ -1081,4 +1081,10 @@ function mysql_db_get_table_count($sql, $search_history_db = false) {
return $count; return $count;
} }
function mysql_get_fields($table) {
global $config;
return db_get_all_rows_sql("SHOW COLUMNS FROM " . $table);
}
?> ?>

View File

@ -1171,4 +1171,20 @@ function db_get_table_count($table, $search_history_db = false) {
break; break;
} }
} }
function db_get_fields($table) {
global $config;
switch ($config["dbtype"]) {
case "mysql":
return mysql_get_fields($table);
break;
case "postgresql":
//return postgresql_get_fields($table);
break;
case "oracle":
//return oracle_get_fields($table);
break;
}
}
?> ?>

View File

@ -1634,7 +1634,9 @@ function html_print_checkbox ($name, $value, $checked = false, $return = false,
* *
* @return string HTML code if return parameter is true. * @return string HTML code if return parameter is true.
*/ */
function html_print_image ($src, $return = false, $options = false, $return_src = false, $relative = false) { function html_print_image ($src, $return = false, $options = false,
$return_src = false, $relative = false) {
global $config; global $config;
// If metaconsole is in use then don't use skins // If metaconsole is in use then don't use skins