Skip to content

Commit

Permalink
Firebird fixes, moved num_rows() method to db_pdo class
Browse files Browse the repository at this point in the history
  • Loading branch information
timw4mail committed Apr 20, 2012
1 parent b4c22c5 commit 8fc9a72
Show file tree
Hide file tree
Showing 44 changed files with 376 additions and 368 deletions.
21 changes: 14 additions & 7 deletions classes/db_pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,20 @@ protected function driver_query($sql, $filtered_index=TRUE)

return ($filtered_index) ? db_filter($all, 0) : $all;
}

// --------------------------------------------------------------------------

/**
* Return the number of rows returned for a SELECT query
*
* @return int
*/
public function num_rows()
{
return isset($this->statement) && is_object($this->statement)
? $this->statement->rowCount()
: FALSE;
}

// -------------------------------------------------------------------------
// ! Abstract public functions to implement in child classes
Expand All @@ -373,13 +387,6 @@ protected function driver_query($sql, $filtered_index=TRUE)
*/
abstract public function truncate($table);

/**
* Return the number of rows for the last SELECT query
*
* @return int
*/
abstract public function num_rows();

/**
* Connect to a different database
*
Expand Down
6 changes: 3 additions & 3 deletions docs/classes/DB_PDO.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</span><pre>inTransaction()</pre></a></li>
<li class="method public "><a href="#lastInsertId" title="lastInsertId :: "><span class="description">lastInsertId()
</span><pre>lastInsertId()</pre></a></li>
<li class="method public "><a href="#num_rows" title="num_rows :: Return the number of rows for the last SELECT query"><span class="description">Return the number of rows for the last SELECT query</span><pre>num_rows()</pre></a></li>
<li class="method public "><a href="#num_rows" title="num_rows :: Return the number of rows returned for a SELECT query"><span class="description">Return the number of rows returned for a SELECT query</span><pre>num_rows()</pre></a></li>
<li class="method public "><a href="#prepare" title="prepare :: "><span class="description">prepare()
</span><pre>prepare()</pre></a></li>
<li class="method public "><a href="#prepare_execute" title="prepare_execute :: Create and execute a prepared statement with the provided parameters"><span class="description">Create and execute a prepared statement with the provided parameters</span><pre>prepare_execute()</pre></a></li>
Expand Down Expand Up @@ -456,7 +456,7 @@ <h2>lastInsertId()
</div></div>
</div>
<a name="num_rows" id="num_rows"></a><div class="element clickable method public num_rows" data-toggle="collapse" data-target=".num_rows .collapse">
<h2>Return the number of rows for the last SELECT query</h2>
<h2>Return the number of rows returned for a SELECT query</h2>
<pre>num_rows() : int</pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8">
Expand Down Expand Up @@ -662,7 +662,7 @@ <h2>Reference to the last executed query</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/classes/DB_Reg.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ <h2>Static array of connections</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/classes/DB_SQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ <h3>Returns</h3>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/classes/DB_Util.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ <h2>Reference to the current connection object</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>
18 changes: 11 additions & 7 deletions docs/classes/Firebird.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</span><pre>inTransaction()</pre></a></li>
<li class="method public inherited"><a href="#lastInsertId" title="lastInsertId :: "><span class="description">lastInsertId()
</span><pre>lastInsertId()</pre></a></li>
<li class="method public "><a href="#num_rows" title="num_rows :: Return the number of rows returned for a SELECT query"><span class="description">Return the number of rows returned for a SELECT query</span><pre>num_rows()</pre></a></li>
<li class="method public inherited"><a href="#num_rows" title="num_rows :: Return the number of rows returned for a SELECT query"><span class="description">Return the number of rows returned for a SELECT query</span><pre>num_rows()</pre></a></li>
<li class="method public "><a href="#prepare" title="prepare :: Emulate PDO prepare"><span class="description">Emulate PDO prepare</span><pre>prepare()</pre></a></li>
<li class="method public "><a href="#prepare_execute" title="prepare_execute :: Prepare and execute a query"><span class="description">Prepare and execute a query</span><pre>prepare_execute()</pre></a></li>
<li class="method public "><a href="#prepare_query" title="prepare_query :: Bind a prepared query with arguments for executing"><span class="description">Bind a prepared query with arguments for executing</span><pre>prepare_query()</pre></a></li>
Expand Down Expand Up @@ -533,9 +533,13 @@ <h2>lastInsertId()
<a name="num_rows" id="num_rows"></a><div class="element clickable method public num_rows" data-toggle="collapse" data-target=".num_rows .collapse">
<h2>Return the number of rows returned for a SELECT query</h2>
<pre>num_rows() : int</pre>
<div class="labels"></div>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="span8">
<p class="long_description"></p>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\DB_PDO::num_rows()</td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code>int</code></div>
</div></div>
Expand Down Expand Up @@ -766,7 +770,7 @@ <h2>Reference to util sub class</h2>
</div>
<a name="%24conn" id="$conn"> </a><div class="element clickable property protected $conn" data-toggle="collapse" data-target=".$conn .collapse">
<h2>Reference to the connection resource</h2>
<pre>$conn </pre>
<pre>$conn : resource</pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8"><p class="long_description"></p></div></div>
</div>
Expand All @@ -784,20 +788,20 @@ <h2>Character to escape identifiers</h2>
</div>
<a name="%24statement" id="$statement"> </a><div class="element clickable property protected $statement" data-toggle="collapse" data-target=".$statement .collapse">
<h2>Reference to the last query executed</h2>
<pre>$statement </pre>
<pre>$statement : object</pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8"><p class="long_description"></p></div></div>
</div>
<a name="%24statement_link" id="$statement_link"> </a><div class="element clickable property protected $statement_link" data-toggle="collapse" data-target=".$statement_link .collapse">
<h2>Reference to the resource returned by
the last query executed</h2>
<pre>$statement_link </pre>
<pre>$statement_link : resource</pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8"><p class="long_description"></p></div></div>
</div>
<a name="%24trans" id="$trans"> </a><div class="element clickable property protected $trans" data-toggle="collapse" data-target=".$trans .collapse">
<h2>Reference to the current transaction</h2>
<pre>$trans </pre>
<pre>$trans : resource</pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8"><p class="long_description"></p></div></div>
</div>
Expand All @@ -808,7 +812,7 @@ <h2>Reference to the current transaction</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>
39 changes: 24 additions & 15 deletions docs/classes/Firebird_Result.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
</span><pre>getColumnMeta()</pre></a></li>
<li class="method public "><a href="#nextRowset" title="nextRowset :: "><span class="description">nextRowset()
</span><pre>nextRowset()</pre></a></li>
<li class="method public "><a href="#num_rows" title="num_rows :: Return the number of rows for the select query"><span class="description">Return the number of rows for the select query</span><pre>num_rows()</pre></a></li>
<li class="method public "><a href="#rowCount" title="rowCount :: Return the number of rows affected by the previous query"><span class="description">Return the number of rows affected by the previous query</span><pre>rowCount()</pre></a></li>
<li class="method public "><a href="#setAttribute" title="setAttribute :: "><span class="description">setAttribute()
</span><pre>setAttribute()</pre></a></li>
Expand All @@ -94,6 +93,8 @@
<li class="nav-header">
<i class="icon-custom icon-property"></i> Properties</li>
<li class="nav-header private">» Private</li>
<li class="property private "><a href="#%24result" title="$result :: Data pulled from query"><span class="description">Data pulled from query</span><pre>$result</pre></a></li>
<li class="property private "><a href="#%24row" title="$row :: Current row in result array"><span class="description">Current row in result array</span><pre>$row</pre></a></li>
<li class="property private "><a href="#%24statement" title="$statement :: Reference to fbird resource"><span class="description">Reference to fbird resource</span><pre>$statement</pre></a></li>
</ul>
</div>
Expand Down Expand Up @@ -377,7 +378,7 @@ <h3>Returns</h3>
</div>
<a name="fetchObject" id="fetchObject"></a><div class="element clickable method public fetchObject" data-toggle="collapse" data-target=".fetchObject .collapse">
<h2>Emulate PDOStatement::fetchObject, but only for the default use</h2>
<pre>fetchObject(string $class_name, array $ctor_args) : mixed</pre>
<pre>fetchObject(string $class_name, array $ctor_args) : <a href="http://php.net/manual/en/class.stdclass.php">\stdClass</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8">
<p class="long_description"></p>
Expand All @@ -391,7 +392,7 @@ <h4>$ctor_args</h4>
<code>array</code>
</div>
<h3>Returns</h3>
<div class="subelement response"><code>mixed</code></div>
<div class="subelement response"><code><a href="http://php.net/manual/en/class.stdclass.php">\stdClass</a></code></div>
</div></div>
</div>
<a name="getAttribute" id="getAttribute"></a><div class="element clickable method public getAttribute" data-toggle="collapse" data-target=".getAttribute .collapse">
Expand Down Expand Up @@ -433,16 +434,6 @@ <h2>nextRowset()
</tr></table>
</div></div>
</div>
<a name="num_rows" id="num_rows"></a><div class="element clickable method public num_rows" data-toggle="collapse" data-target=".num_rows .collapse">
<h2>Return the number of rows for the select query</h2>
<pre>num_rows() : int</pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8">
<p class="long_description"></p>
<h3>Returns</h3>
<div class="subelement response"><code>int</code></div>
</div></div>
</div>
<a name="rowCount" id="rowCount"></a><div class="element clickable method public rowCount" data-toggle="collapse" data-target=".rowCount .collapse">
<h2>Return the number of rows affected by the previous query</h2>
<pre>rowCount() : int</pre>
Expand Down Expand Up @@ -481,9 +472,27 @@ <h2>setFetchMode()
</div>
<h3>
<i class="icon-custom icon-property"></i> Properties</h3>
<a name="%24result" id="$result"> </a><div class="element clickable property private $result" data-toggle="collapse" data-target=".$result .collapse">
<h2>Data pulled from query</h2>
<pre>$result </pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8">
<p class="long_description"></p>
<table class="table table-bordered"><tr>
<th>param</th>
<td>&lt;p&gt;mixed&lt;/p&gt;</td>
</tr></table>
</div></div>
</div>
<a name="%24row" id="$row"> </a><div class="element clickable property private $row" data-toggle="collapse" data-target=".$row .collapse">
<h2>Current row in result array</h2>
<pre>$row : int</pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8"><p class="long_description"></p></div></div>
</div>
<a name="%24statement" id="$statement"> </a><div class="element clickable property private $statement" data-toggle="collapse" data-target=".$statement .collapse">
<h2>Reference to fbird resource</h2>
<pre>$statement </pre>
<pre>$statement : resource</pre>
<div class="labels"></div>
<div class="row collapse"><div class="span8"><p class="long_description"></p></div></div>
</div>
Expand All @@ -494,7 +503,7 @@ <h2>Reference to fbird resource</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/classes/Firebird_SQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ <h3>Returns</h3>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/classes/Firebird_Util.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ <h2>Reference to the current connection object</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>
10 changes: 7 additions & 3 deletions docs/classes/MySQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</span><pre>inTransaction()</pre></a></li>
<li class="method public inherited"><a href="#lastInsertId" title="lastInsertId :: "><span class="description">lastInsertId()
</span><pre>lastInsertId()</pre></a></li>
<li class="method public "><a href="#num_rows" title="num_rows :: Return the number of rows returned for a SELECT query"><span class="description">Return the number of rows returned for a SELECT query</span><pre>num_rows()</pre></a></li>
<li class="method public inherited"><a href="#num_rows" title="num_rows :: Return the number of rows returned for a SELECT query"><span class="description">Return the number of rows returned for a SELECT query</span><pre>num_rows()</pre></a></li>
<li class="method public inherited"><a href="#prepare" title="prepare :: "><span class="description">prepare()
</span><pre>prepare()</pre></a></li>
<li class="method public inherited"><a href="#prepare_execute" title="prepare_execute :: Create and execute a prepared statement with the provided parameters"><span class="description">Create and execute a prepared statement with the provided parameters</span><pre>prepare_execute()</pre></a></li>
Expand Down Expand Up @@ -576,9 +576,13 @@ <h2>lastInsertId()
<a name="num_rows" id="num_rows"></a><div class="element clickable method public num_rows" data-toggle="collapse" data-target=".num_rows .collapse">
<h2>Return the number of rows returned for a SELECT query</h2>
<pre>num_rows() : int</pre>
<div class="labels"></div>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="span8">
<p class="long_description"></p>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\DB_PDO::num_rows()</td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response"><code>int</code></div>
</div></div>
Expand Down Expand Up @@ -844,7 +848,7 @@ <h2>Reference to the last executed query</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/classes/MySQL_SQL.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ <h3>Returns</h3>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/classes/MySQL_Util.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ <h2>Reference to the current connection object</h2>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a2</a> and<br>
generated on 2012-04-20T13:15:56-04:00.<br></footer></div>
generated on 2012-04-20T16:33:01-04:00.<br></footer></div>
</div>
</body>
</html>

0 comments on commit 8fc9a72

Please sign in to comment.