Skip to content

Big CSV file import, are there exec() or shell_exec() commands alternatives? #180

Closed Answered by osc2nuke
osc2nuke asked this question in Q&A
Discussion options

You must be logged in to vote

Finally solved the big CSV IMPORT and took just less then 2 seconds for over 115.000 rows!!!
And i have even 2 solutions for WIN only for now.
First follow the steps in this stackoverflow answer to create the .sql file and have your .csv available:
https://stackoverflow.com/a/36001304/277632

OPTION 1 (requires sqlite3 already installed on the client machine)

        exec("sqlite3 C:/wamp64/www/tvview/database/nativephp.sqlite < C:/wamp64/www/tvview/storage/app/import.sql");

OPTION 2 (Add the sqlite3.exe to your project build and store it somewhere suitable)

        $db = "C:/wamp64/www/tvview/database/nativephp.sqlite";
        $sql = "C:/wamp64/www/tvview/storage/app/import.sql";
      …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by osc2nuke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant