瀏覽代碼

Avoiding $db->num_rows() in include/common_admin.php

Visman 6 年之前
父節點
當前提交
c02be43afe
共有 1 個文件被更改,包括 3 次插入4 次删除
  1. 3 4
      include/common_admin.php

+ 3 - 4
include/common_admin.php

@@ -152,10 +152,9 @@ function prune($forum_id, $prune_sticky, $prune_date)
 	{
 		// not sum - Visman
 		$result = $db->query('SELECT no_sum_mess FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forums', __FILE__, __LINE__, $db->error());
-		if (!$db->num_rows($result))
-			$flag_f = 1;
-		else
-			$flag_f = $db->result($result);
+		$row = $db->fetch_row($result);
+
+		$flag_f = !$row ? 1 : $row[0];
 
 		// уменьшение постов у юзеров и not sum - Visman
 		if ($flag_f == 0)