diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php
index fce91f7925d..5132168c076 100644
--- a/htdocs/install/upgrade.php
+++ b/htdocs/install/upgrade.php
@@ -183,7 +183,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
print '
| '.$langs->trans("ServerVersion").' | ';
print ''.$version.' |
';
dolibarr_install_syslog("upgrade: " . $langs->transnoentities("ServerVersion") . ": " .$version);
- if ($db->type == 'mysqli')
+ if ($db->type == 'mysqli' && function_exists('mysqli_get_charset'))
{
$tmparray = $db->db->get_charset();
print '| '.$langs->trans("ClientCharset").' | ';