本文整理汇总了PHP中okapi\Db::get_affected_row_count方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::get_affected_row_count方法的具体用法?PHP Db::get_affected_row_count怎么用?PHP Db::get_affected_row_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类okapi\Db
的用法示例。
在下文中一共展示了Db::get_affected_row_count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove_notes
private static function remove_notes($cache_id, $user_id)
{
if (Settings::get('OC_BRANCH') == 'oc.de') {
# we can delete row if and only if there are no coords in it
Db::execute("\n delete from coordinates\n where\n type = 2 -- personal note\n and cache_id = '" . Db::escape_string($cache_id) . "'\n and user_id = '" . Db::escape_string($user_id) . "'\n and longitude = 0\n and latitude = 0\n ");
if (Db::get_affected_row_count() <= 0) {
# no rows deleted - record either doesn't exist, or has coords
# remove only description
Db::execute("\n update coordinates\n set description = null\n where\n type = 2\n and cache_id = '" . Db::escape_string($cache_id) . "'\n and user_id = '" . Db::escape_string($user_id) . "'\n ");
}
} else {
# oc.pl branch
Db::execute("\n delete from cache_notes\n where\n cache_id = '" . Db::escape_string($cache_id) . "'\n and user_id = '" . Db::escape_string($user_id) . "'\n ");
}
}