Fixed a bug (#4561) where orhaving() wasn't properly passing values.

Removed some unused variables from the code (#4563).

Fixed a bug where having() was not adding an = into the statement (#4568).
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index dcf9d38..05a0435 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -804,7 +804,7 @@
 

 	function orhaving($key, $value = '', $escape = TRUE)

 	{

-		return $this->or_having($key, $value = '', $escape);

+		return $this->or_having($key, $value, $escape);

 	}	

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

 

@@ -852,7 +852,11 @@
 				$k = $this->_protect_identifiers($k);

 			}

 

-			

+			if ( ! $this->_has_operator($k))

+			{

+				$k .= ' = ';

+			}

+

 			if ($v != '')

 			{

 				$v = ' '.$this->escape_str($v);