Commits

Anonymous committed 31d9ab4

Did a little clean up. Nothing that affected functionality

Comments (0)

Files changed (9)

system/database/DB_active_rec.php

 	/**
 	 * Sets the HAVING values
 	 *
-	 * Called by having() or orhaving()
+	 * Called by having() or or_having()
 	 *
 	 * @access	private
 	 * @param	string
-
 	 * @param	string
 	 * @return	object
 	 */

system/database/DB_forge.php

 	 */
 	function add_key($key = '', $primary = FALSE)
 	{
+		if (is_array($key))
+		{
+			foreach($key as $one)
+			{
+				$this->add_key($one, $primary);
+			}
+			
+			return;
+		}
+	
 		if ($key == '')
 		{
 			show_error('Key information is required for that operation.');

system/database/drivers/mssql/mssql_driver.php

 	 */
 	function db_set_charset($charset, $collation)
 	{
-		// TODO - add support if needed
+		// @todo - add support if needed
 		return TRUE;
 	}
 

system/database/drivers/mysql/mysql_driver.php

 	
 		$query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table));
 		
+		if ($query->num_rows() == 0)
+			return '0';
+
 		$row = $query->row();
 		return (int)$row->numrows;
 	}

system/database/drivers/oci8/oci8_driver.php

 	 */
 	function db_set_charset($charset, $collation)
 	{
-		// TODO - add support if needed
+		// @todo - add support if needed
 		return TRUE;
 	}
 

system/database/drivers/odbc/odbc_driver.php

 	 */
 	function db_set_charset($charset, $collation)
 	{
-		// TODO - add support if needed
+		// @todo - add support if needed
 		return TRUE;
 	}
 

system/database/drivers/postgre/postgre_driver.php

 	 */
 	function db_set_charset($charset, $collation)
 	{
-		// TODO - add support if needed
+		// @todo - add support if needed
 		return TRUE;
 	}
 

system/database/drivers/sqlite/sqlite_driver.php

 	 */
 	function db_set_charset($charset, $collation)
 	{
-		// TODO - add support if needed
+		// @todo - add support if needed
 		return TRUE;
 	}
 
 		@sqlite_close($conn_id);
 	}
 
-	// --------------------------------------------------------------------
-
-	/**
-	 * Rename a table
-	 *
-	 * Generates a platform-specific query so that a table can be renamed
-	 *
-	 * @access	private
-	 * @param	string	the old table name
-	 * @param	string	the new table name
-	 * @return	string
-	 */
-	function _rename_table($table_name, $new_table_name)
-	{
-		$sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name);
-		return $sql;
-	}
-
 
 }
 

system/database/drivers/sqlite/sqlite_forge.php

 			$primary_keys = $this->db->_protect_identifiers($primary_keys);
 			$sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")";
 		}
-		
+
 		if (is_array($keys) && count($keys) > 0)
 		{
 			foreach ($keys as $key)
 				$sql .= ",\n\tUNIQUE (" . implode(', ', $key) . ")";
 			}
 		}
-		
+
 		$sql .= "\n)";
 
 		return $sql;
 		return $sql;
 		
 	}
+
+	// --------------------------------------------------------------------
+
+	/**
+	 * Rename a table
+	 *
+	 * Generates a platform-specific query so that a table can be renamed
+	 *
+	 * @access	private
+	 * @param	string	the old table name
+	 * @param	string	the new table name
+	 * @return	string
+	 */
+	function _rename_table($table_name, $new_table_name)
+	{
+		$sql = 'ALTER TABLE '.$this->db->_protect_identifiers($table_name)." RENAME TO ".$this->db->_protect_identifiers($new_table_name);
+		return $sql;
+	}
 }
 
 /* End of file sqlite_forge.php */