1

I have a ~1MB JSON file that needs to be converted to MySQL. The file has close to 400 records. What is the best way to do this using PHP ?

If i try to add 400 records in a single pass, I either get the memory or execution time error. Whats the best way around this ?

1 Answer 1

1

Try a multi-stage approach. Use json_decode() to turn the records into INSERT statements. Then you can use the FILE command in the mysql client to run all the inserts.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.