ACCDB + PHP grab column name and table

Asked

Viewed 110 times

1

I will upload accdb files in the database to make an import of clients in my system, in a CRM that used I could upload this file and automatically already showed the columns to be able to link with the CRM information. I was able to read the accdb file data by php and even go up, what I needed was to find the table inside that file and the names of the columns to link to the required fields, currently if I know the table name I can even print the file data on the screen but if it is a user going up select would no longer work, and I can give a select in the table columns name?

        $pdo = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=$db; Uid=; Pwd=;");

        $sql = $pdo->prepare("select * from macica");
        $sql->execute();

        while ($linha = $sql->fetch(PDO::FETCH_ASSOC)) {

            print_r($linha);

        }

?>

1 answer

0

You need to have microsoft Access installed on your computer to be able to open a file. accdb, so you can see all tables and queries of it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.