// Remove bad _SQL_USE_SLAVE_ uses + normalize Db->executeS(), Db->execute() and Db->numRows() names
This commit is contained in:
@@ -27,13 +27,13 @@
|
||||
|
||||
function add_attribute_position()
|
||||
{
|
||||
$groups = Db::getInstance()->ExecuteS('
|
||||
$groups = Db::getInstance()->executeS('
|
||||
SELECT `id_attribute_group`
|
||||
FROM `'._DB_PREFIX_.'attribute`');
|
||||
if (sizeof($groups) && is_array($groups))
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
$attributes = Db::getInstance()->ExecuteS('
|
||||
$attributes = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'attribute`
|
||||
WHERE `id_attribute_group` = '. (int)($group['id_attribute_group']));
|
||||
@@ -41,7 +41,7 @@ function add_attribute_position()
|
||||
if (sizeof($attributes) && is_array($attributes))
|
||||
foreach ($attributes as $attribute)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'attribute`
|
||||
SET `position` = '.$i++.'
|
||||
WHERE `id_attribute` = '.(int)$attribute['id_attribute'].'
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
|
||||
function add_default_restrictions_modules_groups()
|
||||
{
|
||||
$groups = Db::getInstance()->ExecuteS('
|
||||
$groups = Db::getInstance()->executeS('
|
||||
SELECT `id_group`
|
||||
FROM `'._DB_PREFIX_.'group`');
|
||||
$modules = Db::getInstance()->ExecuteS('
|
||||
$modules = Db::getInstance()->executeS('
|
||||
SELECT m.*
|
||||
FROM `'._DB_PREFIX_.'module` m');
|
||||
foreach ($groups as $group)
|
||||
@@ -44,7 +44,7 @@ function add_default_restrictions_modules_groups()
|
||||
$sql .= '("'.(int)$group['id_group'].'", "'.(int)$mod['id_module'].'", "1"),';
|
||||
// removing last comma to avoid SQL error
|
||||
$sql = substr($sql, 0, strlen($sql) - 1);
|
||||
Db::getInstance()->Execute($sql);
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,14 +27,14 @@
|
||||
|
||||
function add_feature_position()
|
||||
{
|
||||
$features = Db::getInstance()->ExecuteS('
|
||||
$features = Db::getInstance()->executeS('
|
||||
SELECT `id_feature`
|
||||
FROM `'._DB_PREFIX_.'feature`');
|
||||
$i = 0;
|
||||
if (sizeof($features) && is_array($features))
|
||||
foreach ($features as $feature)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'feature`
|
||||
SET `position` = '.$i++.'
|
||||
WHERE `id_feature` = '.(int)$feature['id_feature']);
|
||||
|
||||
@@ -27,14 +27,14 @@
|
||||
|
||||
function add_group_attribute_position()
|
||||
{
|
||||
$groups = Db::getInstance()->ExecuteS('
|
||||
$groups = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'attribute_group`');
|
||||
$i = 0;
|
||||
if (sizeof($groups) && is_array($groups))
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'attribute_group`
|
||||
SET `position` = '.$i++.'
|
||||
WHERE `id_attribute_group` = '.(int)$group['id_attribute_group']);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
function add_missing_rewrite_value()
|
||||
{
|
||||
$pages = Db::getInstance()->ExecuteS('
|
||||
$pages = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'meta` m
|
||||
LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.`id_meta` = ml.`id_meta`)
|
||||
@@ -37,7 +37,7 @@ function add_missing_rewrite_value()
|
||||
if (sizeof($pages) && is_array($pages))
|
||||
foreach ($pages as $page)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'meta_lang`
|
||||
SET `url_rewrite` = "'.pSQL(Tools::str2url($page['title'])).'"
|
||||
WHERE `id_meta` = '.(int)$page['id_meta'].'
|
||||
|
||||
@@ -42,7 +42,7 @@ function add_module_to_hook($module_name, $hook_name)
|
||||
|
||||
if ((int)$id_hook > 0)
|
||||
{
|
||||
$result = Db::getInstance()->Execute('
|
||||
$result = Db::getInstance()->execute('
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`)
|
||||
VALUES (
|
||||
'.(int)$id_module.',
|
||||
|
||||
@@ -35,12 +35,12 @@ function add_new_tab($className, $name, $id_parent, $returnId = false)
|
||||
}
|
||||
|
||||
if (!(int)Db::getInstance()->getValue('SELECT count(id_tab) FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($className).'\' '))
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'tab` (`id_parent`, `class_name`, `module`, `position`) VALUES ('.(int)$id_parent.', \''.pSQL($className).'\', \'\',
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'tab` (`id_parent`, `class_name`, `module`, `position`) VALUES ('.(int)$id_parent.', \''.pSQL($className).'\', \'\',
|
||||
(SELECT IFNULL(MAX(t.position),0)+ 1 FROM `'._DB_PREFIX_.'tab` t WHERE t.id_parent = '.(int)$id_parent.'))');
|
||||
|
||||
foreach (Language::getLanguages() AS $lang)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'tab_lang` (`id_lang`, `id_tab`, `name`)
|
||||
VALUES ('.(int)$lang['id_lang'].', (
|
||||
SELECT `id_tab`
|
||||
@@ -50,7 +50,7 @@ function add_new_tab($className, $name, $id_parent, $returnId = false)
|
||||
');
|
||||
}
|
||||
|
||||
Db::getInstance()->Execute('INSERT IGNORE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`)
|
||||
Db::getInstance()->execute('INSERT IGNORE INTO `'._DB_PREFIX_.'access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `delete`)
|
||||
(SELECT `id_profile`, (
|
||||
SELECT `id_tab`
|
||||
FROM `'._DB_PREFIX_.'tab`
|
||||
|
||||
@@ -42,7 +42,7 @@ function add_order_state($conf_name, $name, $invoice, $send_email, $color, $unre
|
||||
$template_lang[$temp[0]] = $temp[1];
|
||||
}
|
||||
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'order_state` (`invoice`, `send_email`, `color`, `unremovable`, `logable`, `delivery`)
|
||||
VALUES ('.(int)$invoice.', '.(int)$send_email.', \''.pSQL($color).'\', '.(int)$unremovable.', '.(int)$logable.', '.(int)$delivery.')');
|
||||
|
||||
@@ -53,7 +53,7 @@ function add_order_state($conf_name, $name, $invoice, $send_email, $color, $unre
|
||||
|
||||
foreach (Language::getLanguages() AS $lang)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT IGNORE INTO `'._DB_PREFIX_.'order_state_lang` (`id_lang`, `id_order_state`, `name`, `template`)
|
||||
VALUES ('.(int)$lang['id_lang'].', '.(int)$id_order_state.', \''.pSQL(isset($name_lang[$lang['iso_code']]) ? $name_lang[$lang['iso_code']] : $name_lang['en']).'\', \''.pSQL(isset($template_lang[$lang['iso_code']]) ? $template_lang[$lang['iso_code']] : (isset($template_lang['en']) ? $template_lang['en'] : '')).'\')
|
||||
');
|
||||
|
||||
@@ -34,11 +34,11 @@
|
||||
function check_webservice_account_table()
|
||||
{
|
||||
$sql = 'SHOW COLUMNS FROM '._DB_PREFIX_.'webservice_account';
|
||||
$return = DB::getInstance()->ExecuteS($sql);
|
||||
$return = DB::getInstance()->executeS($sql);
|
||||
if (count($return) < 7)
|
||||
{
|
||||
$sql = 'ALTER TABLE `'._DB_PREFIX_.'webservice_account` ADD `is_module` TINYINT( 2 ) NOT NULL DEFAULT \'0\' AFTER `class_name` ,
|
||||
ADD `module_name` VARCHAR( 50 ) NULL DEFAULT NULL AFTER `is_module`';
|
||||
DB::getInstance()->ExecuteS($sql);
|
||||
DB::getInstance()->executeS($sql);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
function configuration_double_cleaner()
|
||||
{
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT name, MIN(id_configuration) AS minid
|
||||
FROM '._DB_PREFIX_.'configuration
|
||||
GROUP BY name
|
||||
|
||||
@@ -7,8 +7,8 @@ function create_multistore()
|
||||
$themes = scandir(dirname(__FILE__).'/../../themes');
|
||||
foreach ($themes AS $theme)
|
||||
if (is_dir(dirname(__FILE__).'/../../themes/'.$theme) && $theme != '.' && $theme != '..' && $theme != 'prestashop')
|
||||
$res &= Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'theme (`id_theme`, `name`) VALUES(\'\', \''.pSQL($theme).'\')');
|
||||
$res &= Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'shop SET id_theme = (SELECT id_theme FROM '._DB_PREFIX_.'theme WHERE name=\''.pSQL(_THEME_NAME_).'\') WHERE id_shop = 1');
|
||||
$res &= Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'theme (`id_theme`, `name`) VALUES(\'\', \''.pSQL($theme).'\')');
|
||||
$res &= Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'shop SET id_theme = (SELECT id_theme FROM '._DB_PREFIX_.'theme WHERE name=\''.pSQL(_THEME_NAME_).'\') WHERE id_shop = 1');
|
||||
$shop_domain = Db::getInstance()->getValue('SELECT `value`
|
||||
FROM `'._DB_PREFIX_.'_configuration`
|
||||
WHERE `name`=\'PS_SHOP_DOMAIN\'');
|
||||
@@ -23,17 +23,17 @@ function create_multistore()
|
||||
|
||||
$_PS_DIRECTORY_ = trim(str_replace(' ', '%20', INSTALLER__PS_BASE_URI), '/');
|
||||
$_PS_DIRECTORY_ = ($_PS_DIRECTORY_) ? '/'.$_PS_DIRECTORY_.'/' : '/';
|
||||
$res &= Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'shop_url` (`id_shop`, `domain`, `domain_ssl`, `physical_uri`, `virtual_uri`, `main`, `active`)
|
||||
$res &= Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'shop_url` (`id_shop`, `domain`, `domain_ssl`, `physical_uri`, `virtual_uri`, `main`, `active`)
|
||||
VALUES(1, \''.pSQL($shop_domain).'\', \''.pSQL($shop_domain_ssl).'\', \''.pSQL($_PS_DIRECTORY_).'\', \'\', 1, 1)');
|
||||
|
||||
// Stock conversion
|
||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'.stock` (`id_product`, `id_product_attribute`, `id_group_shop`, `id_shop`, `quantity`)
|
||||
VALUES (SELECT `p.id_product`, 0, 1, 1, `p.quantity` FROM `'._DB_PREFIX_.'.product` p);';
|
||||
$res &= Db::getInstance()->Execute($sql);
|
||||
$res &= Db::getInstance()->execute($sql);
|
||||
|
||||
$sql = 'INSERT INTO `'._DB_PREFIX_.'.stock` (`id_product`, `id_product_attribute`, `id_group_shop`, `id_shop`, `quantity`)
|
||||
VALUES (SELECT `id_product`, `id_product_attribute`, 1, 1, `quantity` FROM `'._DB_PREFIX_.'product_attribute` p);';
|
||||
$res &= Db::getInstance()->Execute($sql);
|
||||
$res &= Db::getInstance()->execute($sql);
|
||||
|
||||
// Add admin tabs
|
||||
$shopTabId = add_new_tab('AdminShop', 'it:Shops|es:Shops|fr:Boutiques|de:Shops|en:Shops', 0, true);
|
||||
|
||||
@@ -29,14 +29,14 @@ define('_CONTAINS_REQUIRED_FIELD_', 2);
|
||||
|
||||
function add_required_customization_field_flag()
|
||||
{
|
||||
if (($result = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'customization_field` WHERE `required` = 1')) === false)
|
||||
if (($result = Db::getInstance()->executeS('SELECT `id_product` FROM `'._DB_PREFIX_.'customization_field` WHERE `required` = 1')) === false)
|
||||
return false;
|
||||
if (Db::getInstance()->numRows())
|
||||
{
|
||||
$productIds = array();
|
||||
foreach ($result AS $row)
|
||||
$productIds[] = (int)($row['id_product']);
|
||||
if (!Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET `customizable` = '._CONTAINS_REQUIRED_FIELD_.' WHERE `id_product` IN ('.implode(', ', $productIds).')'))
|
||||
if (!Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'product` SET `customizable` = '._CONTAINS_REQUIRED_FIELD_.' WHERE `id_product` IN ('.implode(', ', $productIds).')'))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -31,7 +31,7 @@ function delivery_number_set()
|
||||
$number = 1;
|
||||
|
||||
// Update each order with a number
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT id_order
|
||||
FROM '._DB_PREFIX_.'orders
|
||||
ORDER BY id_order');
|
||||
@@ -44,7 +44,7 @@ function delivery_number_set()
|
||||
$oS = new OrderState((int)($row2['id_order_state']), Configuration::get('PS_LANG_DEFAULT'));
|
||||
if ($oS->delivery)
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'orders SET delivery_number = '.(int)($number++).', `delivery_date` = `date_add` WHERE id_order = '.(int)($order->id));
|
||||
Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET delivery_number = '.(int)($number++).', `delivery_date` = `date_add` WHERE id_order = '.(int)($order->id));
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ function desactivate_custom_modules()
|
||||
$arrNativeModules[] = '"'.pSQL($module['name']).'"';
|
||||
}
|
||||
|
||||
$arrNonNative = $db->ExecuteS('
|
||||
$arrNonNative = $db->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'module` m
|
||||
WHERE name NOT IN ('.implode(',',$arrNativeModules).') ');
|
||||
@@ -57,7 +57,7 @@ function desactivate_custom_modules()
|
||||
foreach ($uninstallMe as $k=>$v)
|
||||
$uninstallMe[$k] = '"'.pSQL($v).'"';
|
||||
|
||||
return Db::getInstance()->Execute('
|
||||
return Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'module`
|
||||
SET `active`= 0
|
||||
WHERE `name` IN ('.implode(',',$uninstallMe).')');
|
||||
|
||||
@@ -31,14 +31,14 @@ function editorial_update()
|
||||
|
||||
if (Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name`="editorial"'))
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE `'._DB_PREFIX_.'editorial` (
|
||||
`id_editorial` int(10) unsigned NOT NULL auto_increment,
|
||||
`body_home_logo_link` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id_editorial`))
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8');
|
||||
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
CREATE TABLE `'._DB_PREFIX_.'editorial_lang` (
|
||||
`id_editorial` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
@@ -52,13 +52,13 @@ function editorial_update()
|
||||
if (file_exists(dirname(__FILE__).'/../../modules/editorial/editorial.xml'))
|
||||
{
|
||||
$xml = simplexml_load_file(dirname(__FILE__).'/../../modules/editorial/editorial.xml');
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'editorial`(`id_editorial`, `body_home_logo_link`) VALUES(1, "'.(isset($xml->body->home_logo_link) ? pSQL($xml->body->home_logo_link) : '').'")');
|
||||
|
||||
|
||||
$languages = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'lang`');
|
||||
$languages = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'lang`');
|
||||
foreach ($languages as $language)
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'editorial_lang` (`id_editorial`, `id_lang`, `body_title`, `body_subheading`, `body_paragraph`, `body_logo_subheading`)
|
||||
VALUES (1, '.(int)($language['id_lang']).',
|
||||
"'.(isset($xml->body->{'title_'.$language['id_lang']}) ? pSQL($xml->body->{'title_'.$language['id_lang']}) : '').'",
|
||||
|
||||
@@ -17,7 +17,7 @@ function generate_tax_rules()
|
||||
$id_tax_rules_group = $group->id;
|
||||
|
||||
|
||||
$countries = Db::getInstance()->ExecuteS('
|
||||
$countries = Db::getInstance()->executeS('
|
||||
SELECT * FROM `'._DB_PREFIX_.'country` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'zone` z ON (c.`id_zone` = z.`id_zone`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'tax_zone` tz ON (tz.`id_zone` = z.`id_zone`)
|
||||
@@ -27,7 +27,7 @@ function generate_tax_rules()
|
||||
{
|
||||
foreach ($countries AS $country)
|
||||
{
|
||||
$res = Db::getInstance()->Execute('
|
||||
$res = Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'tax_rule` (`id_tax_rules_group`, `id_country`, `id_state`, `state_behavior`, `id_tax`)
|
||||
VALUES (
|
||||
'.(int)$group->id.',
|
||||
@@ -40,7 +40,7 @@ function generate_tax_rules()
|
||||
}
|
||||
}
|
||||
|
||||
$states = Db::getInstance()->ExecuteS('
|
||||
$states = Db::getInstance()->executeS('
|
||||
SELECT * FROM `'._DB_PREFIX_.'states s
|
||||
LEFT JOIN `'._DB_PREFIX_.'tax_state ts ON (ts.`id_state` = s.`id_state`)
|
||||
WHERE `id_tax` = '.(int)$id_tax
|
||||
@@ -55,7 +55,7 @@ function generate_tax_rules()
|
||||
else
|
||||
$tax_behavior = $state['tax_behavior'];
|
||||
|
||||
$res = Db::getInstance()->Execute('
|
||||
$res = Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'tax_rule` (`id_tax_rules_group`, `id_country`, `id_state`, `state_behavior`, `id_tax`)
|
||||
VALUES (
|
||||
'.(int)$group->id.',
|
||||
@@ -67,13 +67,13 @@ function generate_tax_rules()
|
||||
}
|
||||
}
|
||||
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'product`
|
||||
SET `id_tax_rules_group` = '.(int)$group->id.'
|
||||
WHERE `id_tax` = '.(int)$id_tax
|
||||
);
|
||||
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'carrier`
|
||||
SET `id_tax_rules_group` = '.(int)$group->id.'
|
||||
WHERE `id_tax` = '.(int)$id_tax
|
||||
|
||||
@@ -31,7 +31,7 @@ function invoice_number_set()
|
||||
$number = 1;
|
||||
|
||||
// Update each order with a number
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT id_order
|
||||
FROM '._DB_PREFIX_.'orders
|
||||
ORDER BY id_order');
|
||||
@@ -44,7 +44,7 @@ function invoice_number_set()
|
||||
$oS = new OrderState((int)($row2['id_order_state']), Configuration::get('PS_LANG_DEFAULT'));
|
||||
if ($oS->invoice)
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'orders SET invoice_number = '.(int)($number++).', `invoice_date` = `date_add` WHERE id_order = '.(int)($order->id));
|
||||
Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'orders SET invoice_number = '.(int)($number++).', `invoice_date` = `date_add` WHERE id_order = '.(int)($order->id));
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ function migrate_block_info_to_cms_block()
|
||||
//get ids cms of block information
|
||||
$id_blockinfos = Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name = \'blockinfos\'');
|
||||
//get ids cms of block information
|
||||
$ids_cms = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'block_cms` WHERE `id_block` = '.(int)$id_blockinfos);
|
||||
$ids_cms = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'block_cms` WHERE `id_block` = '.(int)$id_blockinfos);
|
||||
//check if block info is installed and active
|
||||
if (sizeof($ids_cms))
|
||||
{
|
||||
@@ -38,16 +38,16 @@ function migrate_block_info_to_cms_block()
|
||||
if (Module::getInstanceByName('blockcms')->install())
|
||||
{
|
||||
//add new block in new cms block
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'cms_block` (`id_cms_category`, `name`, `location`, `position`) VALUES( 1, \'\', 0, 0)');
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'cms_block` (`id_cms_category`, `name`, `location`, `position`) VALUES( 1, \'\', 0, 0)');
|
||||
$id_block = Db::getInstance()->Insert_ID();
|
||||
|
||||
$languages = Language::getLanguages(false);
|
||||
foreach($languages AS $language)
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'cms_block_lang` (`id_cms_block`, `id_lang`, `name`) VALUES ('.(int)$id_block.', '.(int)$language['id_lang'].', \'Information\')');
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'cms_block_lang` (`id_cms_block`, `id_lang`, `name`) VALUES ('.(int)$id_block.', '.(int)$language['id_lang'].', \'Information\')');
|
||||
|
||||
//save ids cms of block information in new module cms bloc
|
||||
foreach($ids_cms AS $id_cms)
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'cms_block_page` (`id_cms_block`, `id_cms`, `is_category`) VALUES ('.(int)$id_block.', '.(int)$id_cms['id_cms'].', 0)');
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'cms_block_page` (`id_cms_block`, `id_cms`, `is_category`) VALUES ('.(int)$id_block.', '.(int)$id_cms['id_cms'].', 0)');
|
||||
}
|
||||
else
|
||||
return true;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
function move_crossselling()
|
||||
{
|
||||
|
||||
if (Db::getInstance()->ExecuteS('SELECT FROM `'._DB_PREFIX_.'module` WHERE `name` = \'crossselling\''))
|
||||
if (Db::getInstance()->executeS('SELECT FROM `'._DB_PREFIX_.'module` WHERE `name` = \'crossselling\''))
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'hook_module` (`id_module`, `id_hook`, `position`)
|
||||
VALUES ((SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \'crossselling\'), 9, (SELECT max_position FROM (SELECT MAX(position)+1 as max_position FROM `'._DB_PREFIX_.'hook_module` WHERE `id_hook` = 9) tmp))');
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ function convert_product_price()
|
||||
$taxRates = array();
|
||||
foreach ($taxes as $data)
|
||||
$taxRates[$data['id_tax']] = (float)($data['rate']) / 100;
|
||||
$resource = DB::getInstance()->ExecuteS('SELECT `id_product`, `price`, `id_tax` FROM `'._DB_PREFIX_.'product`', false);
|
||||
$resource = DB::getInstance()->executeS('SELECT `id_product`, `price`, `id_tax` FROM `'._DB_PREFIX_.'product`', false);
|
||||
if (!$resource)
|
||||
die(Db::getInstance()->getMsgError());
|
||||
while ($row = DB::getInstance()->nextRow($resource))
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*/
|
||||
function regenerate_level_depth()
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'category` SET `level_depth` = 0 WHERE `id_category` = 1');
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'category` SET `level_depth` = 0 WHERE `id_category` = 1');
|
||||
regenerate_children_categories(1, 0);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ function regenerate_level_depth()
|
||||
*/
|
||||
function regenerate_children_categories($id_category, $level_depth)
|
||||
{
|
||||
$categories = Db::getInstance()->ExecuteS('SELECT `id_category` FROM `'._DB_PREFIX_.'category` WHERE `id_parent` = '.(int)$id_category);
|
||||
$categories = Db::getInstance()->executeS('SELECT `id_category` FROM `'._DB_PREFIX_.'category` WHERE `id_parent` = '.(int)$id_category);
|
||||
if (!$categories)
|
||||
return;
|
||||
$new_depth = (int)$level_depth + 1;
|
||||
@@ -54,5 +54,5 @@ function regenerate_children_categories($id_category, $level_depth)
|
||||
}
|
||||
$cat_ids = substr($cat_ids, 0, -1);
|
||||
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'category` SET `level_depth` = '.(int)$new_depth.' WHERE `id_category` IN ('.$cat_ids.')');
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'category` SET `level_depth` = '.(int)$new_depth.' WHERE `id_category` IN ('.$cat_ids.')');
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*/
|
||||
function remove_duplicate_category_groups()
|
||||
{
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT `id_category`, `id_group`, COUNT(*) as `count`
|
||||
FROM `'._DB_PREFIX_.'category_group`
|
||||
GROUP BY `id_category`, `id_group`
|
||||
@@ -41,7 +41,7 @@ function remove_duplicate_category_groups()
|
||||
if ((int)$row['count'] > 1)
|
||||
{
|
||||
$limit = (int)$row['count'] - 1;
|
||||
$result = Db::getInstance()->Execute('
|
||||
$result = Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'category_group`
|
||||
WHERE `id_category` = '.$row['id_category'].' AND `id_group` = '.$row['id_group'].'
|
||||
LIMIT '.$limit);
|
||||
|
||||
@@ -42,7 +42,7 @@ function remove_module_from_hook($module_name, $hook_name)
|
||||
|
||||
if ((int)$id_hook > 0)
|
||||
{
|
||||
$result = Db::getInstance()->Execute('
|
||||
$result = Db::getInstance()->execute('
|
||||
DELETE FROM `'._DB_PREFIX_.'hook_module`
|
||||
WHERE `id_module` = '.(int)$id_module.' AND `id_hook` = '.(int)$id_hook);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
function remove_tab($tabname)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
DELETE t, l
|
||||
FROM `ps_tab` t LEFT JOIN `PREFIX_tab_lang` l ON (t.id_tab = l.id_tab)
|
||||
WHERE t.`class_name` = '.pSQL($tabname));
|
||||
|
||||
@@ -35,10 +35,10 @@ function reorderpositions()
|
||||
//clean Category position and delete old position system
|
||||
Language::loadLanguages();
|
||||
$language = Language::getLanguages();
|
||||
$cat_parent = Db::getInstance()->ExecuteS('SELECT DISTINCT c.id_parent FROM `'._DB_PREFIX_.'category` c WHERE id_category != 1');
|
||||
$cat_parent = Db::getInstance()->executeS('SELECT DISTINCT c.id_parent FROM `'._DB_PREFIX_.'category` c WHERE id_category != 1');
|
||||
foreach($cat_parent AS $parent)
|
||||
{
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT c.*, cl.*
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)(Configuration::get('PS_LANG_DEFAULT')).')
|
||||
@@ -46,14 +46,14 @@ function reorderpositions()
|
||||
ORDER BY name ASC');
|
||||
foreach($result AS $i => $categ)
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'category`
|
||||
SET `position` = '.(int)($i).'
|
||||
WHERE `id_parent` = '.(int)($categ['id_parent']).'
|
||||
AND `id_category` = '.(int)($categ['id_category']));
|
||||
}
|
||||
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT DISTINCT c.*, cl.*
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`)
|
||||
@@ -62,7 +62,7 @@ function reorderpositions()
|
||||
|
||||
// Remove number from category name
|
||||
foreach($result AS $i => $categ)
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'category` c
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'category` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category`)
|
||||
SET `name` = \''.preg_replace('/^[0-9]+\./', '',$categ['name']).'\'
|
||||
WHERE c.id_category = '.(int)($categ['id_category']).' AND id_lang = \''.(int)($categ['id_lang']).'\'');
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
|
||||
function set_discount_category()
|
||||
{
|
||||
$discounts = Db::getInstance()->ExecuteS('SELECT `id_discount` FROM `'._DB_PREFIX_.'discount`');
|
||||
$categories = Db::getInstance()->ExecuteS('SELECT `id_category` FROM `'._DB_PREFIX_.'category`');
|
||||
$discounts = Db::getInstance()->executeS('SELECT `id_discount` FROM `'._DB_PREFIX_.'discount`');
|
||||
$categories = Db::getInstance()->executeS('SELECT `id_category` FROM `'._DB_PREFIX_.'category`');
|
||||
foreach ($discounts AS $discount)
|
||||
foreach ($categories AS $category)
|
||||
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'discount_category` (`id_discount`,`id_category`) VALUES ('.(int)($discount['id_discount']).','.(int)($category['id_category']).')');
|
||||
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'discount_category` (`id_discount`,`id_category`) VALUES ('.(int)($discount['id_discount']).','.(int)($category['id_category']).')');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -40,10 +40,10 @@ function set_payment_module()
|
||||
$content = fread($fd, filesize($file));
|
||||
if (preg_match_all('/extends PaymentModule/U', $content, $matches))
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'module_country` (id_module, id_country)
|
||||
SELECT '.(int)($module['id_module']).', id_country FROM `'._DB_PREFIX_.'country` WHERE active = 1');
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'module_currency` (id_module, id_currency)
|
||||
SELECT '.(int)($module['id_module']).', id_currency FROM `'._DB_PREFIX_.'currency` WHERE deleted = 0');
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ function set_payment_module_group()
|
||||
$content = fread($fd, filesize($file));
|
||||
if (preg_match_all('/extends PaymentModule/U', $content, $matches))
|
||||
{
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'module_group` (id_module, id_group)
|
||||
SELECT '.(int)($module['id_module']).', id_group FROM `'._DB_PREFIX_.'group`');
|
||||
}
|
||||
|
||||
@@ -32,6 +32,6 @@ function update_module_followup()
|
||||
if (!$followup->id)
|
||||
return;
|
||||
|
||||
Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'log_email` ADD INDEX `date_add`(`date_add`), ADD INDEX `id_cart`(`id_cart`);');
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'log_email` ADD INDEX `date_add`(`date_add`), ADD INDEX `id_cart`(`id_cart`);');
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
function update_order_detail_taxes()
|
||||
{
|
||||
$order_detail_taxes = Db::getInstance()->ExecuteS('
|
||||
$order_detail_taxes = Db::getInstance()->executeS('
|
||||
SELECT `id_order_detail`, `tax_name`, `tax_rate` FROM `'._DB_PREFIX_.'order_detail`
|
||||
');
|
||||
|
||||
@@ -36,7 +36,7 @@ function update_order_detail_taxes()
|
||||
$id_tax = $tax->id;
|
||||
}
|
||||
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'order_detail_tax` (`id_order_detail`, `id_tax`)
|
||||
VALUES ('.(int)$order_detail_tax['id_order_detail'].','.$id_tax.')
|
||||
');
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
|
||||
function update_order_details()
|
||||
{
|
||||
$res = Db::getInstance()->ExecuteS('SHOW COLUMNS FROM `'._DB_PREFIX_.'order_detail` LIKE \'reduction_percent\'');
|
||||
$res = Db::getInstance()->executeS('SHOW COLUMNS FROM `'._DB_PREFIX_.'order_detail` LIKE \'reduction_percent\'');
|
||||
|
||||
if (sizeof($res) == 0)
|
||||
{
|
||||
Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `reduction_percent` DECIMAL(10, 2) NOT NULL default \'0.00\' AFTER `product_price`');
|
||||
Db::getInstance()->Execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `reduction_amount` DECIMAL(20, 6) NOT NULL default \'0.000000\' AFTER `reduction_percent`');
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `reduction_percent` DECIMAL(10, 2) NOT NULL default \'0.00\' AFTER `product_price`');
|
||||
Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'order_detail` ADD `reduction_amount` DECIMAL(20, 6) NOT NULL default \'0.000000\' AFTER `reduction_percent`');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ function update_products_ecotax_v133()
|
||||
global $oldversion;
|
||||
if($oldversion < '1.3.3.0')
|
||||
{
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'product` SET `ecotax` = \'0\' WHERE 1');
|
||||
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'order_detail` SET `ecotax` = \'0\' WHERE 1;');
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'product` SET `ecotax` = \'0\' WHERE 1');
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'order_detail` SET `ecotax` = \'0\' WHERE 1;');
|
||||
}
|
||||
}
|
||||
@@ -31,12 +31,12 @@ function update_carrier_url()
|
||||
$sql = '
|
||||
SELECT c.`id_carrier`, c.`url`
|
||||
FROM `'._DB_PREFIX_.'carrier` c';
|
||||
$carriers = Db::getInstance()->ExecuteS($sql);
|
||||
$carriers = Db::getInstance()->executeS($sql);
|
||||
|
||||
// Check each one and erase carrier URL if not correct URL
|
||||
foreach ($carriers as $carrier)
|
||||
if (!Validate::isAbsoluteUrl($carrier['url']))
|
||||
Db::getInstance()->Execute('
|
||||
Db::getInstance()->execute('
|
||||
UPDATE `'._DB_PREFIX_.'carrier`
|
||||
SET `url` = \'\'
|
||||
WHERE `id_carrier`= '.(int)($carrier['id_carrier']));
|
||||
|
||||
@@ -30,12 +30,12 @@ function update_modules_sql()
|
||||
Configuration::loadConfiguration();
|
||||
$blocklink = Module::getInstanceByName('blocklink');
|
||||
if ($blocklink->id)
|
||||
Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'blocklink_lang` ADD PRIMARY KEY (`id_link`, `id_lang`);');
|
||||
Db::getInstance()->execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'blocklink_lang` ADD PRIMARY KEY (`id_link`, `id_lang`);');
|
||||
$productComments = Module::getInstanceByName('productcomments');
|
||||
if ($productComments->id)
|
||||
{
|
||||
Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_grade` ADD PRIMARY KEY (`id_product_comment`, `id_product_comment_criterion`);');
|
||||
Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_criterion` DROP PRIMARY KEY, ADD PRIMARY KEY (`id_product_comment_criterion`, `id_lang`);');
|
||||
Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_criterion_product` ADD PRIMARY KEY(`id_product`, `id_product_comment_criterion`);');
|
||||
Db::getInstance()->execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_grade` ADD PRIMARY KEY (`id_product_comment`, `id_product_comment_criterion`);');
|
||||
Db::getInstance()->execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_criterion` DROP PRIMARY KEY, ADD PRIMARY KEY (`id_product_comment_criterion`, `id_lang`);');
|
||||
Db::getInstance()->execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment_criterion_product` ADD PRIMARY KEY(`id_product`, `id_product_comment_criterion`);');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,31 +27,31 @@
|
||||
|
||||
function updateproductcomments()
|
||||
{
|
||||
if (Db::getInstance()->ExecuteS('SELECT * FROM '._DB_PREFIX_.'product_comment') !== false)
|
||||
if (Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'product_comment') !== false)
|
||||
{
|
||||
Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS '._DB_PREFIX_.'product_comment_criterion_lang (
|
||||
Db::getInstance()->execute('CREATE TABLE IF NOT EXISTS '._DB_PREFIX_.'product_comment_criterion_lang (
|
||||
`id_product_comment_criterion` INT( 11 ) UNSIGNED NOT NULL ,
|
||||
`id_lang` INT(11) UNSIGNED NOT NULL ,
|
||||
`name` VARCHAR(64) NOT NULL ,
|
||||
PRIMARY KEY ( `id_product_comment_criterion` , `id_lang` )
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8');
|
||||
Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS '._DB_PREFIX_.'product_comment_criterion_category (
|
||||
Db::getInstance()->execute('CREATE TABLE IF NOT EXISTS '._DB_PREFIX_.'product_comment_criterion_category (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product_comment_criterion`, `id_category`),
|
||||
KEY `id_category` (`id_category`)
|
||||
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8');
|
||||
Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `id_guest` INT(11) NULL AFTER `id_customer`');
|
||||
Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `customer_name` varchar(64) NULL AFTER `content`');
|
||||
Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `deleted` tinyint(1) NOT NULL AFTER `validate`');
|
||||
Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_customer)');
|
||||
Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_guest)');
|
||||
Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_product)');
|
||||
Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion DROP `id_lang`');
|
||||
Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion DROP `name`');
|
||||
Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion ADD `id_product_comment_criterion_type` tinyint(1) NOT NULL AFTER `id_product_comment_criterion`');
|
||||
Db::getInstance()->Execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion ADD `active` tinyint(1) NOT NULL AFTER `id_product_comment_criterion_type`');
|
||||
Db::getInstance()->Execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment` ADD `title` VARCHAR(64) NULL AFTER `id_guest`;');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `id_guest` INT(11) NULL AFTER `id_customer`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `customer_name` varchar(64) NULL AFTER `content`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD `deleted` tinyint(1) NOT NULL AFTER `validate`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_customer)');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_guest)');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment ADD INDEX (id_product)');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion DROP `id_lang`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion DROP `name`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion ADD `id_product_comment_criterion_type` tinyint(1) NOT NULL AFTER `id_product_comment_criterion`');
|
||||
Db::getInstance()->execute('ALTER TABLE '._DB_PREFIX_.'product_comment_criterion ADD `active` tinyint(1) NOT NULL AFTER `id_product_comment_criterion_type`');
|
||||
Db::getInstance()->execute('ALTER IGNORE TABLE `'._DB_PREFIX_.'product_comment` ADD `title` VARCHAR(64) NULL AFTER `id_guest`;');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ function updatetabicon_from_11version()
|
||||
if (version_compare($oldversion,'1.5.0.0','<'))
|
||||
{
|
||||
|
||||
$rows = Db::getInstance()->ExecuteS('SELECT `id_tab`,`class_name` FROM '._DB_PREFIX_.'tab');
|
||||
$rows = Db::getInstance()->executeS('SELECT `id_tab`,`class_name` FROM '._DB_PREFIX_.'tab');
|
||||
if (sizeof($rows))
|
||||
{
|
||||
$img_dir = scandir(_PS_IMG_DIR_.'/t/');
|
||||
|
||||
@@ -86,7 +86,7 @@ function latin1_database_to_utf8()
|
||||
foreach ($tables AS $table)
|
||||
{
|
||||
/* Latin1 datas' selection */
|
||||
if (!Db::getInstance()->Execute('SET NAMES latin1'))
|
||||
if (!Db::getInstance()->execute('SET NAMES latin1'))
|
||||
echo 'Cannot change the sql encoding to latin1!';
|
||||
$query = 'SELECT `'.$table['id'].'`';
|
||||
foreach ($table['fields'] AS $field)
|
||||
@@ -94,7 +94,7 @@ function latin1_database_to_utf8()
|
||||
if (isset($table['lang']) AND $table['lang'])
|
||||
$query .= ', `id_lang`';
|
||||
$query .= ' FROM `'._DB_PREFIX_.$table['name'].'`';
|
||||
$latin1Datas = Db::getInstance()->ExecuteS($query);
|
||||
$latin1Datas = Db::getInstance()->executeS($query);
|
||||
if ($latin1Datas === false)
|
||||
{
|
||||
$warningExist = true;
|
||||
@@ -109,7 +109,7 @@ function latin1_database_to_utf8()
|
||||
if (Db::getInstance()->NumRows())
|
||||
{
|
||||
/* Utf-8 datas' restitution */
|
||||
if (!Db::getInstance()->Execute('SET NAMES utf8'))
|
||||
if (!Db::getInstance()->execute('SET NAMES utf8'))
|
||||
echo 'Cannot change the sql encoding to utf8!';
|
||||
foreach ($latin1Datas AS $latin1Data)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ function latin1_database_to_utf8()
|
||||
$query .= ' WHERE `'.$table['id'].'` = '.(int)($latin1Data[$table['id']]);
|
||||
if (isset($table['lang']) AND $table['lang'])
|
||||
$query .= ' AND `id_lang` = '.(int)($latin1Data['id_lang']);
|
||||
if (!Db::getInstance()->Execute($query))
|
||||
if (!Db::getInstance()->execute($query))
|
||||
{
|
||||
$warningExist = true;
|
||||
$requests .= '
|
||||
|
||||
Reference in New Issue
Block a user