|
@@ -62,11 +62,11 @@ try{
|
|
|
while($srcData = $stmtSrc->fetch(PDO::FETCH_ASSOC)){
|
|
while($srcData = $stmtSrc->fetch(PDO::FETCH_ASSOC)){
|
|
|
#插入目标表
|
|
#插入目标表
|
|
|
$data = array(
|
|
$data = array(
|
|
|
- (int)$srcData["sent1"],
|
|
|
|
|
- (int)$srcData["sent2"],
|
|
|
|
|
- (int)$srcData["sim"]
|
|
|
|
|
- );
|
|
|
|
|
- try{
|
|
|
|
|
|
|
+ $srcData["sent1"],
|
|
|
|
|
+ $srcData["sent2"],
|
|
|
|
|
+ $srcData["sim"]
|
|
|
|
|
+ );
|
|
|
|
|
+ try{
|
|
|
$stmtDEST->execute($data);
|
|
$stmtDEST->execute($data);
|
|
|
}catch(PDOException $e){
|
|
}catch(PDOException $e){
|
|
|
fwrite(STDERR,"error:".$e->getMessage().PHP_EOL);
|
|
fwrite(STDERR,"error:".$e->getMessage().PHP_EOL);
|
|
@@ -83,7 +83,7 @@ while($srcData = $stmtSrc->fetch(PDO::FETCH_ASSOC)){
|
|
|
|
|
|
|
|
// 提交更改
|
|
// 提交更改
|
|
|
$PDO_DEST->commit();
|
|
$PDO_DEST->commit();
|
|
|
-fwrite(STDOUT, "done".PHP_EOL);
|
|
|
|
|
|
|
+fwrite(STDOUT, "done insert {$count} rows".PHP_EOL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|