| @@ 1446-1467 (lines=22) @@ | ||
| 1443 | ); |
|
| 1444 | ||
| 1445 | $result = true; |
|
| 1446 | foreach ($tables as $pair) { |
|
| 1447 | foreach ($pair as $_table => $_field) { |
|
| 1448 | $result = $result && $this->config->getDb()->query(sprintf('UPDATE %s SET %s = %d WHERE %s = %d', |
|
| 1449 | Db::getTablePrefix().$_table, |
|
| 1450 | $_field, |
|
| 1451 | $temp_cat, |
|
| 1452 | $_field, |
|
| 1453 | $category_id_2)); |
|
| 1454 | $result = $result && $this->config->getDb()->query(sprintf('UPDATE %s SET %s = %d WHERE %s = %d', |
|
| 1455 | Db::getTablePrefix().$_table, |
|
| 1456 | $_field, |
|
| 1457 | $category_id_2, |
|
| 1458 | $_field, |
|
| 1459 | $category_id_1)); |
|
| 1460 | $result = $result && $this->config->getDb()->query(sprintf('UPDATE %s SET %s = %d WHERE %s = %d', |
|
| 1461 | Db::getTablePrefix().$_table, |
|
| 1462 | $_field, |
|
| 1463 | $category_id_1, |
|
| 1464 | $_field, |
|
| 1465 | $temp_cat)); |
|
| 1466 | } |
|
| 1467 | } |
|
| 1468 | ||
| 1469 | $tables2 = array(array('faqquestions' => 'category_id')); |
|
| 1470 | ||
| @@ 1471-1492 (lines=22) @@ | ||
| 1468 | ||
| 1469 | $tables2 = array(array('faqquestions' => 'category_id')); |
|
| 1470 | ||
| 1471 | foreach ($tables2 as $pair) { |
|
| 1472 | foreach ($pair as $_table => $_field) { |
|
| 1473 | $result = $result && $this->config->getDb()->query(sprintf("UPDATE %s SET %s = '%d' WHERE %s = '%d'", |
|
| 1474 | Db::getTablePrefix().$_table, |
|
| 1475 | $_field, |
|
| 1476 | $temp_cat, |
|
| 1477 | $_field, |
|
| 1478 | $category_id_2)); |
|
| 1479 | $result = $result && $this->config->getDb()->query(sprintf("UPDATE %s SET %s = '%d' WHERE %s = '%d'", |
|
| 1480 | Db::getTablePrefix().$_table, |
|
| 1481 | $_field, |
|
| 1482 | $category_id_2, |
|
| 1483 | $_field, |
|
| 1484 | $category_id_1)); |
|
| 1485 | $result = $result && $this->config->getDb()->query(sprintf("UPDATE %s SET %s = '%d' WHERE %s = '%d'", |
|
| 1486 | Db::getTablePrefix().$_table, |
|
| 1487 | $_field, |
|
| 1488 | $category_id_1, |
|
| 1489 | $_field, |
|
| 1490 | $temp_cat)); |
|
| 1491 | } |
|
| 1492 | } |
|
| 1493 | ||
| 1494 | return $result; |
|
| 1495 | } |
|