Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 929500e

Browse files
author
Ivan Dudarev
committed
pdo statement moved from array to variable
1 parent 7e2bdf8 commit 929500e

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/Converter.php

+4-9
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,8 @@ protected function createTmpDb()
550550

551551
$sql = 'CREATE '.'TABLE `_ips` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `ip` INTEGER,`action` TEXT, `parameter` TEXT, `value` TEXT, `offset` TEXT); CREATE INDEX `ip` ON `_ips` (`ip`); CREATE INDEX `parameter` ON `_ips` (`parameter`); CREATE INDEX `value` ON `_ips` (`value`);';
552552
$this->pdo->exec($sql);
553-
$prepare['insert']['ips'] = $this->pdo->prepare('INSERT '.'INTO `_ips` (`ip`,`action`,`parameter`,`value`) VALUES (:ip,:action,:parameter,:value);');
554-
$prepare['insert']['ips']->execute(array(
553+
$prepareInsertIpsStatement = $this->pdo->prepare('INSERT '.'INTO `_ips` (`ip`,`action`,`parameter`,`value`) VALUES (:ip,:action,:parameter,:value);');
554+
$prepareInsertIpsStatement->execute(array(
555555
'ip' => 0,
556556
'action' => 'add',
557557
'parameter' => NULL,
@@ -604,20 +604,15 @@ protected function createTmpDb()
604604
$lastIp = $lip;
605605
break;
606606
}
607-
/**
608-
* @var \PDOStatement $s
609-
*/
610-
611-
$s = $prepare['insert']['ips'];
612607
foreach ($network['registers'] as $register => $column) {
613608
$value = isset($row[$column]) ? $row[$column] : null;
614-
$s->execute(array(
609+
$prepareInsertIpsStatement->execute(array(
615610
'ip' => $firstIp,
616611
'action' => 'add',
617612
'parameter' => $register,
618613
'value' => $value,
619614
));
620-
$s->execute(array(
615+
$prepareInsertIpsStatement->execute(array(
621616
'ip' => $lastIp + 1,
622617
'action' => 'remove',
623618
'parameter' => $register,

0 commit comments

Comments
 (0)