Extract data from .mdb file to mysql database using php

Possible duplicate:
Access from PHP to .mdb file on Ubuntu

Hi, I am developing a web store using php framework yii ..

I want to upload a .mdb file to our system and extract the data from it and paste it into the mysql database.

Is there any of this?

It will be great if someone can help me.

thank

+3
source share
2 answers

Use the odbc_connect () function using the database source name (DSN). Alternatively, you can use the DSN-less connection string.

connections to DSN-less

If there is no password, leave the username as "sa" and the password is empty.

$conn = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdb_file", $user, $password);

DSN Connection

* http://www.w3schools.com/php/php_db_odbc.asp*

"" " (ODBC)" . " DSN". "" " DSN". Microsoft Access Driver. "". "", . (DSN). "".

$conn = odbc_connect($dsn_name, $user, $password);

Query:

$res = odbc_exec($conn, "select * from table");

:

while( $row = odbc_fetch_array($res) ) { 
    print_r($row); 
}

: http://www.php.net/manual/en/ref.uodbc.php

+6

mdb csv

csv mysql

0

All Articles