Charset koi8r

Charset koi8r

kagatankagatan Posts: 3Questions: 2Answers: 0
edited May 2014 in DataTables 1.10

My database is charset=koi8r_general_ci . When outputting data (DataTables server-side ) to get a table "???"

Previously used the command
" mysql_set_charset('koi8r'); "

How to be now?

Answers

  • kagatankagatan Posts: 3Questions: 2Answers: 0

    Found the solution! Need to change the code ssp.class.php :

    array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ) >>> to >>>>
    array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)

    static function sql_connect ( $sql_details )
    {
    try {
    $db = @new PDO(
    "mysql:host={$sql_details['host']};dbname={$sql_details['db']};",
    $sql_details['user'],
    $sql_details['pass'],
    array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)
    //array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION )
    );
    }
    catch (PDOException $e) {
    SSP::fatal(
    "An error occurred while connecting to the database. ".
    "The error reported by the server was: ".$e->getMessage()
    );
    }

        return $db;
    }
    
This discussion has been closed.