Skip to content
This repository has been archived by the owner on Mar 29, 2019. It is now read-only.

use exec instead of query to solve: #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public static function executeBatch(Connection $connection, $query, $callback =
call_user_func($callback, $q, $db);
}

$db->query($q);
$db->exec($q);

} catch (\Exception $e) {
throw new BatchImportException($sql, $e->getMessage(), 0, $e);
throw new BatchImportException($q, $e->getMessage(), 0, $e);
}

$query = substr($query, $offset);
Expand Down Expand Up @@ -103,7 +103,7 @@ public static function loadFromFile(Connection $connection, $file, $callback = N
if ($callback) {
call_user_func($callback, $sql, ftell($handle));
}
$connection->query($sql);
$connection->exec($sql);
$sql = '';
$count++;

Expand All @@ -116,7 +116,7 @@ public static function loadFromFile(Connection $connection, $file, $callback = N
if ($callback) {
call_user_func($callback, $sql, ftell($handle));
}
$connection->query($sql);
$connection->exec($sql);
$count++;
}

Expand Down