fetch(); $charset = $schemaRow['CHARACTER_SET_NAME']; $colation = !empty($schemaRow['COLLATION_NAME']) ? $schemaRow['COLLATION_NAME'] : self::getCollationIfNotProvided($tableName); return array( 'collation' => ($colation && $colation != '') ? $colation : false, 'charset' => ($charset && $charset != '') ? $charset : false ); } public static function setCollationForTableStructure(&$struct, $collationDetails) { if($collationDetails['collation']) { $struct['COLLATE'] = $collationDetails['collation']; } if($collationDetails['charset']) { $struct['charset'] = $collationDetails['charset']; } } public static function getCollationIfNotProvided($tableName) { $tableName = main\mgLibs\MySQL\query::realEscapeString($tableName); $collation = main\mgLibs\MySQL\query::query("SHOW TABLE STATUS LIKE '$tableName' ")->fetch(); return $collation['Collation']; } }