From e97b13635f8985ac88add9659ae6a78e67006b9b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 3 Apr 2008 21:23:13 +0000 Subject: replaced isset() with array_key_exists() in row() to allow retrieval of individual fields with MySQL NULL values --- system/database/DB_result.php | 3 ++- user_guide/changelog.html | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 7d5097911..6461431e2 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -133,7 +133,8 @@ class CI_DB_result { $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 870e21c1d..4e3ca7ced 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -78,6 +78,7 @@ Change Log
  • Modified img() in the HTML Helper to remove an unneeded space (#4208).
  • Modified anchor() in the URL helper to convert entities in the title attribute (#4209).
  • Fixed a bug in link_tag() of the URL helper where a key was passed instead of a value.
  • +
  • Fixed a bug in DB_result::row() that prevented it from returning individual fields with MySQL NULL values
  • Plugins -- cgit v1.2.3-24-g4f1b