summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2012-02-20 23:54:39 +0100
committerTimothy Warren <tim@timshomepage.net>2012-02-20 23:54:39 +0100
commit2da66edce7c249c0305153a65c4292311f49a546 (patch)
tree44419cd80632889375dac2602972578038c0808b
parent95562144da88784588fb2477fa0070576bd386a0 (diff)
Fix counting issue, minor formatting
-rw-r--r--system/database/drivers/interbase/interbase_forge.php2
-rw-r--r--system/database/drivers/interbase/interbase_result.php22
2 files changed, 15 insertions, 9 deletions
diff --git a/system/database/drivers/interbase/interbase_forge.php b/system/database/drivers/interbase/interbase_forge.php
index c7372a0bf..d21a5551b 100644
--- a/system/database/drivers/interbase/interbase_forge.php
+++ b/system/database/drivers/interbase/interbase_forge.php
@@ -79,7 +79,7 @@ class CI_DB_interbase_forge extends CI_DB_forge {
{
$sql = 'CREATE TABLE ';
- $sql .= $this->db->_escape_identifiers($table)."(";
+ $sql .= $this->db->_protect_identifiers($table)."(";
$current_field_count = 0;
foreach ($fields as $field=>$attributes)
diff --git a/system/database/drivers/interbase/interbase_result.php b/system/database/drivers/interbase/interbase_result.php
index 7a3a41f2c..9caf1ce91 100644
--- a/system/database/drivers/interbase/interbase_result.php
+++ b/system/database/drivers/interbase/interbase_result.php
@@ -82,7 +82,7 @@ class CI_DB_interbase_result extends CI_DB_result {
public function list_fields()
{
$field_names = array();
- for ($i = 0, $num_fields=$this->num_fields(); $i < $num_fields; $i++)
+ for ($i = 0, $num_fields = $this->num_fields(); $i < $num_fields; $i++)
{
$info = ibase_field_info($this->result_id, $i);
$field_names[] = $info['name'];
@@ -104,7 +104,7 @@ class CI_DB_interbase_result extends CI_DB_result {
{
$retval = array();
- for ($i = 0, $num_fields=$this->num_fields(); $i < $num_fields; $i++)
+ for ($i = 0, $num_fields = $this->num_fields(); $i < $num_fields; $i++)
{
$info = ibase_field_info($this->result_id, $i);
@@ -164,10 +164,13 @@ class CI_DB_interbase_result extends CI_DB_result {
*/
protected function _fetch_assoc()
{
- //Increment row count
- $this->num_rows++;
+ if(($row = @ibase_fetch_assoc($this->result_id, IBASE_FETCH_BLOBS)) !== FALSE)
+ {
+ //Increment row count
+ $this->num_rows++;
+ }
- return @ibase_fetch_assoc($this->result_id, IBASE_FETCH_BLOBS);
+ return $row;
}
// --------------------------------------------------------------------
@@ -181,10 +184,13 @@ class CI_DB_interbase_result extends CI_DB_result {
*/
protected function _fetch_object()
{
- //Increment row count
- $this->num_rows++;
+ if(($row = @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS)) !== FALSE)
+ {
+ //Increment row count
+ $this->num_rows++;
+ }
- return @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS);
+ return $row;
}
// --------------------------------------------------------------------