ACCDB + PHP get name of columns and table

1

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

        $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);

        }

? >

    
asked by anonymous 03.11.2018 / 15:55

1 answer

0

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

    
28.11.2018 / 17:12