Index: includes/database.php
===================================================================
--- includes/database.php	(revision 1753)
+++ includes/database.php	(working copy)
@@ -472,7 +474,26 @@
 		if (count($results)) return $results;
 		else return null;
 	}
-
+
+	/**
+	 * Create new entry in database table $table containing $values
+	 * 
+	 * @param $table table to insert values into. WARNING: This value is not sanitized!
+	 * @param $values assoc of column->value. WARNING: This value SHOULD NOT be sanitized
+	 * @return int returns the id of the created row or false on error
+	 */
+	function insert( $table, $values ) {
+		$_columns = array();
+		$_values = array();
+		foreach ( $values as $c => $v ) {
+			$_columns[] = "`$c`";
+			$_values[] = "'" . $this->getEscaped($v) . "'";
+		}
+		$this->setBareQuery("INSERT INTO $table ( " . implode( ",", $_columns) . " ) VALUES ( " . implode( ",", $_values ) . " )");
+		if(!$this->query()) return false;
+		return mysql_insert_id();
+	}
+	
 	/**
 	* Document::db_insertObject()
 	*
