1

Вычитываю массив, в нем ориентировочно 3840 строк. Вот код

$insert = $this->DBH->prepare("INSERT into `sometable` VALUES(:id,:name_city,:city_ref)");

foreach($this->arrayCity['data'] AS $item_data)
{
    $insert->bindParam(':id', $item_data['CityID']);  
    $insert->bindParam(':name_city', $item_data['DescriptionRu']);  
    $insert->bindParam(':city_ref', $item_data['Ref']);
    $insert->execute();
}   

Получаю одну такую ошибку :

PDO::exec(): SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Получаю массу вот таких ошибок:

PDOStatement::execute(): SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Пробовал вот это:

SET session interactive_timeout=28800;
SET session wait_timeout=28800;
SET global max_allowed_packet=104857600;  

Не помогает. Что делать?

1

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Посмотрите другие вопросы с метками или задайте свой вопрос.