Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Miyava's avatar

Php File content into Multiple Talbes

I have a File with over 360.000 Rows, every line is a JSON.

i read the Json into Php Variables and insert it into two Tables

"movies" and "movies_details"

i'm using Laravel 5.4. My Problem is the Performance. so i can insert round about 35-40 rows in one minute with this code

$idMovie = DB::table('movies')
   ->insertGetId([
       'moviedb_id' => $id,
       'adult' => $adult,
       'created_at' => $dateTime,
  ]);
  DB::table('movies_title')
      ->insert([
          'movie_id' => $idMovie,
          'original_title' => $original_title,
          'created_at' => $dateTime,
      ]);

but i thing anyone know a faster and better way to insert this.

Thanks for your time.

0 likes
0 replies

Please or to participate in this conversation.