Browse Source

function count_rows add WHERE c_id = ".api_get_course_int_id()

Hubert Borderiou 13 years ago
parent
commit
fedbf05cf2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      main/inc/lib/database.lib.php

+ 1 - 1
main/inc/lib/database.lib.php

@@ -378,7 +378,7 @@ class Database {
      * @return int The number of rows in the given table.
      */
     public static function count_rows($table) {
-        $obj = self::fetch_object(self::query("SELECT COUNT(*) AS n FROM $table"));
+        $obj = self::fetch_object(self::query("SELECT COUNT(*) AS n FROM $table WHERE c_id = ".api_get_course_int_id()));   // 
         return $obj->n;
     }