[pLog-svn] r3288 - plog/trunk/class/dao

mark at devel.lifetype.net mark at devel.lifetype.net
Thu Apr 27 19:15:17 GMT 2006


Author: mark
Date: 2006-04-27 19:15:17 +0000 (Thu, 27 Apr 2006)
New Revision: 3288

Modified:
   plog/trunk/class/dao/model.class.php
Log:
Change the getNumItems from count(*) to count($pk) according to Christoph's suggestion.

Modified: plog/trunk/class/dao/model.class.php
===================================================================
--- plog/trunk/class/dao/model.class.php	2006-04-27 16:09:32 UTC (rev 3287)
+++ plog/trunk/class/dao/model.class.php	2006-04-27 19:15:17 UTC (rev 3288)
@@ -473,11 +473,11 @@
          * @param cond
          * @return the number of items or 0 if none or error
          */
-        function getNumItems( $table, $cond = "" )
+        function getNumItems( $table, $cond = "", $pk = "id" )
         {
             // build up the query
             if( $cond != "" ) $cond = "WHERE $cond";
-            $query = "SELECT COUNT(*) AS total FROM $table $cond";
+            $query = "SELECT COUNT($pk) AS total FROM $table $cond";
 
             // execute it
             $result = $this->Execute( $query );



More information about the pLog-svn mailing list