// Remove bad _SQL_USE_SLAVE_ uses + normalize Db->executeS(), Db->execute() and Db->numRows() names

This commit is contained in:
rMalie
2011-10-10 12:18:56 +00:00
parent 149c814a45
commit 9510337b1d
280 changed files with 1971 additions and 1966 deletions
+4 -4
View File
@@ -33,7 +33,7 @@ function show_countries($id_lang, $nb_by_line = 7)
$output = '<style type="text/css">.country{cursor: pointer;} .country:hover{text-decoration: underline;}</style>
<script type="text/javascript">$(document).ready(_registerClickOnCountry);</script>';
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT cl.`id_country`, `name`, `iso_code` FROM `'._DB_PREFIX_.'country_lang` cl
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT cl.`id_country`, `name`, `iso_code` FROM `'._DB_PREFIX_.'country_lang` cl
LEFT JOIN `'._DB_PREFIX_.'country` c ON c.`id_country` = cl.`id_country`
WHERE `id_lang` = \''.(int)($id_lang).'\' ORDER BY `name` ASC;');
$separator = 0;
@@ -56,7 +56,7 @@ function show_buttons($id_lang, $id_country)
$output = '<script type="text/javascript">$(document).ready(_registerClickButtons);</script>
<span id="selectinfo" style="text-align: center;"></span> ';
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT cl.`id_country`, `name`, `iso_code`, `x`, `y` FROM `'._DB_PREFIX_.'country_lang` cl
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT cl.`id_country`, `name`, `iso_code`, `x`, `y` FROM `'._DB_PREFIX_.'country_lang` cl
LEFT JOIN `'._DB_PREFIX_.'country` c ON c.`id_country` = cl.`id_country`
LEFT JOIN `'._DB_PREFIX_.'location_coords` lc ON c.`id_country` = lc.`id_country`
WHERE `id_lang` = \''.(int)($id_lang).'\' AND cl.`id_country`= \''.(int)($id_country).'\';');
@@ -80,8 +80,8 @@ function insert_coords($id_lang, $id_country, $x, $y)
{
if (!is_numeric($id_lang) || !is_numeric($id_country) || !is_numeric($x) || !is_numeric($y))
return ("error");
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'location_coords` WHERE `id_country` = \''.$id_country.'\';');
if (!Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'location_coords` (`x`, `y`, `id_country`) VALUES (\''.(int)($x).'\', \''.(int)($y).'\', \''.(int)($id_country).'\');'))
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'location_coords` WHERE `id_country` = \''.$id_country.'\';');
if (!Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'location_coords` (`x`, `y`, `id_country`) VALUES (\''.(int)($x).'\', \''.(int)($y).'\', \''.(int)($id_country).'\');'))
echo("error while inserting data<br />");
return (show_countries($id_lang));
}