3 // vim: expandtab sw=4 ts=4 sts=4:
5 if (!defined('PMA_MYSQL_CHARSETS_LIB_INCLUDED')){
6 define('PMA_MYSQL_CHARSETS_LIB_INCLUDED', 1);
8 $res = PMA_mysql_query('SHOW VARIABLES LIKE "character_sets";', $userlink)
9 or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW VARIABLES LIKE "character_sets";');
10 $row = PMA_mysql_fetch_row($res);
11 @mysql_free_result
($res);
14 $charsets_tmp = explode(' ', $row[1]);
17 $mysql_charsets = array();
19 for ($i = 0; isset($charsets_tmp[$i]); $i++
) {
20 if (strpos(' ' . $charsets_tmp[$i], '_')) {
21 $current = substr($charsets_tmp[$i], 0, strpos($charsets_tmp[$i], '_'));
23 $current = $charsets_tmp[$i];
25 if (!in_array($current, $mysql_charsets)) {
26 $mysql_charsets[] = $current;
34 if (PMA_PHP_INT_VERSION
>= 40000) {
35 sort($mysql_charsets, SORT_STRING
);
37 sort($mysql_charsets);
40 } // $__PMA_MYSQL_CHARSETS_LIB__