One way would be to change it to something like:
$query = true;
foreach ($country_ids as $key=>$value) {
// Here is the problem
$db->setQuery("DELETE FROM ".$db->quoteName('#__countries')."
WHERE `country_id` = ".(int)$value." AND `id` = ".(int)$ids[$key]);
if (!$db->execute())
{
$query = false;
break; // we break out of the loop if any query fails. No sense
in doing more queries if we are going to roll back in any case.
}
}
if ($query == true) ...
Mark
> --
> You received this message because you are subscribed to the Google Groups
> "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
joomla-dev-gene...@googlegroups.com.
> To post to this group, send an email to
joomla-de...@googlegroups.com.
> Visit this group at
>
http://groups.google.com/group/joomla-dev-general?hl=en-GB.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>