本文整理匯總了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 ");
}
}