Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008

    Unanswered: codepage iso-8859-2 DB2 -> php

    Hello. I'm doing a website in php and I'm using DB2.
    PHP Code:
    class connectPDO{

    __construct() {
    $this->database 'db';
    $this->user 'user';
    $this->password 'pass';
    $this->hostname 'localhost';
    $this->port 50000;

        public function 
    connect() {
    $pdo=new PDO($conn_string);
    PDOException $err){
                print (

    PHP Code:
    $ObPdo = new connectPDO();
    $pdo $ObPdo->connect();
    $sql='CALL infoForm(:str)';
    $stmt $pdo->prepare($sql);
    $stmt ){
    $newstring='<select name="'.$str.'">';
    $i=0$i<$tab $i++) {
    $newstring.='<option value="'.$i.'">'.$tab[$i].'</option>';

    This query return bad string because I'm using /// content="text/html; charset=iso-8859-2" /// so how to change connecting/query (some examples) with base db2.

    To connecting with MySql I using
    PHP Code:
    mysql_query("set character_set_connection = latin2"); 

  2. #2
    Join Date
    Jun 2009

    I think you can not change db2 codepage by PHP

    on db2 console have you defined your DB Codepage ? 912 (latin2) using these commands :

    (your_instance is DB2 by default)

    set db2instance=your_instance
    db2set DB2CODEPAGE=912

  3. #3
    Join Date
    Dec 2008
    Yes. You are right. I changed the code page setdb2 db2codepage=1208 and in website source I changed the <meta http-equiv="Content-Type" content="text/html; charset=charset=UTF-8" /> and I have signs PL.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts