mercredi 4 juillet 2018

how to import or connect csv database into php

I'm currently building a web based data display (charts, table and stuff) for a large database using php. our company didn't let us use the sql for stacking more than half a year of data for us, but our auditing division need data much more past than that. they let us with ourselves to combine the data and then share it with the rest of the team.

We are currently using qlikview to merge our files as we don't have any sql application, (the only thing we can access is myphpadmin which only gives you 2mb limitation to upload). Qlikview only exports into two kind of database 1. QVD 2.CSV/TXT

I saw a few articles and saw a driver in the ODBC connection management in windows, so i thought it was possible to connect the two of them.

here is my code i use to generate the header list:

<thead>              
<tr>           
        <?php 
               $conn=odbc_connect('splistcsv', '', '');

               $data = "SELECT * FROM splistcsv";

               if($conn){echo "horray";}else{echo"oh no";}

                       $dataquery = odbc_exec($conn, $data);

                       for($i=1; $i <= odbc_num_fields($dataquery); $i++)
                         echo "<th value=".odbc_field_name($dataquery, $i).">".odbc_field_name($dataquery, $i)."</th>"?>
                   </tr>
           </thead>

but it keep returning error:

Warning: odbc_exec(): SQL error: [Microsoft][ODBC Text Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data., SQL state S1000 in SQLExecDirect in C:\xampp\htdocs\42project\pagination.php on line 211"

does anyone has a reference i can use to connect a csv / text database to php? thank you very much before




Aucun commentaire:

Enregistrer un commentaire