replaced isset() with array_key_exists() in row() to allow retrieval of individual fields with MySQL NULL values
diff --git a/system/database/DB_result.php b/system/database/DB_result.php
index 7d50979..6461431 100644
--- a/system/database/DB_result.php
+++ b/system/database/DB_result.php
@@ -133,7 +133,8 @@
$this->row_data = $this->row_array(0);
}
- if (isset($this->row_data[$n]))
+ // array_key_exists() instead of isset() to allow for MySQL NULL values
+ if (array_key_exists($n, $this->row_data)))
{
return $this->row_data[$n];
}
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 870e21c..4e3ca7c 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -78,6 +78,7 @@
<li>Modified <kbd>img()</kbd> in the <a href="helpers/html_helper.html">HTML Helper</a> to remove an unneeded space (#4208).</li>
<li>Modified <kbd>anchor()</kbd> in the <a href="helpers/url_helper.html">URL helper</a> to convert entities in the title attribute (#4209).</li>
<li>Fixed a bug in <kbd>link_tag()</kbd> of the <a href="helpers/url_helper.html">URL helper</a> where a key was passed instead of a value.</li>
+ <li>Fixed a bug in DB_result::row() that prevented it from returning individual fields with MySQL NULL values</li>
</ul>
</li>
<li>Plugins