I have no idea why I'm experiencing this bug.
I have the following script:
foreach($brands as $brand){ // about 600items for this loop
....
....
DB::table('mailing_list')->insert(array(
'email' => $email,
'source' => $source,
'source_url'=> $brand->external_url,
'facebook_url' => $facebook_url,
'instagram_id' => $instagram_username,
'instagram_url' => $instagram_url,
'instagram_followers' => $instagram_followers
));
}
which breaks always at the same item
Error while sending STMT_PREPARE packet. PID=2 (SQL: insert into `mailing_list` (`email`, `source`, `source_url`, `facebook_url`, `instagram_id`, `instagram_url`, `instagram_followers`) values (some@email.com, source, www.url.com, https://www.facebook.com/url, some_username, http://instagram.com/url, 501))
Before I was getting 29 queries executed, now 34.
I would like to understand this error better: it might be the single entry breaking it, but even if the data I posted are gibberish the actual ones look fine to me.
WHAT I'VE TRIED:
set_time_limit(3600);
DB::connection()->disableQueryLog();
DB::reconnect(Config::get('database.default')); // this one after each foreach loop