[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r5403 - phpcompta/trunk/include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r5403 - phpcompta/trunk/include |
Date: |
Thu, 19 Sep 2013 16:22:22 +0200 (CEST) |
Author: danydb
Date: 2013-09-19 16:22:22 +0200 (Thu, 19 Sep 2013)
New Revision: 5403
Modified:
phpcompta/trunk/include/class_database.php
Log:
count accept a parameter, by default returns the number of rows of the last
query
Modified: phpcompta/trunk/include/class_database.php
===================================================================
--- phpcompta/trunk/include/class_database.php 2013-09-19 12:08:00 UTC (rev
5402)
+++ phpcompta/trunk/include/class_database.php 2013-09-19 14:22:22 UTC (rev
5403)
@@ -347,17 +347,24 @@
if ( $this->ret == false ) throw new Exception ('this->ret is empty');
return pg_fetch_array($this->ret,$p_indice ) ;
}
- /address@hidden return the number of rows found by the last query,
- synomym for count()*/
- function size()
+ /address@hidden return the number of rows found by the last query, or the
number
+ * of rows from $p_ret
+ * @param $p_ret is the result of a query, the default value is null, in
that case
+ * it is related to the last query
+ * @note synomym for count()
+ */
+ function size($p_ret = null)
{
- return pg_NumRows($this->ret);
+ if ($p_ret == null )
+ return pg_NumRows($this->ret);
+ else
+ return pg_NumRows($p_ret);
}
/address@hidden return the number of rows found by the last query,
synomym for size()*/
- function count()
+ function count($p_ret=null)
{
- return pg_NumRows($this->ret);
+ return $this->size($p_ret);
}
/*!\brief loop to apply all the path to a folder or
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r5403 - phpcompta/trunk/include,
phpcompta-dev <=