tags:

views:

23

answers:

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  A: 

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.

Kalium