Welcome Guest, Not a member yet? Register   Sign In
ODBC driver with access database
#1

Since i've checked everywhere and i couldn't find any solid solution or explanation here's the problem:

I'm trying to use (more like for educational purposes only) an MS Access database with .mdb. So far i've managed to get to the file with the following settings (for future users who might want an answer):

database.php
PHP Code:
$db['default'] = array(
    
'dsn'    => '',
    
'hostname' => 'DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=D:/xampp/htdocs/<path_of_your_project>/odbc.mdb;charset=UTF8;',
    
'username' => '',
    
'password' => '',
    
'database' => 'D:/xampp/htdocs/<path_of_your_project>/odbc.mdb',
    
'dbdriver' => 'odbc',
    
'dbprefix' => '',
    
'pconnect' => FALSE,
    
'db_debug' => (ENVIRONMENT !== 'production'),
    
'cache_on' => FALSE,
    
'cachedir' => '',
    
'char_set' => 'utf8',
    
'dbcollat' => 'utf8_general_ci',
    
'swap_pre' => '',
    
'encrypt' => FALSE,
    
'compress' => FALSE,
    
'stricton' => FALSE,
    
'failover' => array(),
    
'save_queries' => TRUE
); 

and the query: 
PHP Code:
$users $this->db->query("SELECT * FROM users");

$result $users->result_array(); 

Now the big issue here is that since some of the entries in there contain Greek characters, the result i get from this is:

Code:
Array
(
    [0] => Array
        (
            [�������������] => 1
            [Firstname] => �����
            [Lastname] => ��������
            [email] => [email protected]
            [������] => no
        )

    [1] => Array
        (
            [�������������] => 2
            [Firstname] => ����
            [Lastname] => ���
            [email] => [email protected]
            [������] => yes
        )

)

1) Is it possible to solve this?

2) I use MySQLi in my works, the above came up as a result of a project that was built with Classic ASP and i'd like to know if it's possible to use this with Codeigniter too..


Thanks in advance!

//Life motto
if (sad() == true) {
     sad().stop();
     develop();
}
Reply




Theme © iAndrew 2016 - Forum software by © MyBB