public function updateObject($table, &$object, $key) {

		$sets		= array();
		$where		= array();
		$fieldVal	= array();
		$condVal	= array();

		// set table key and values on where conditions
		foreach (get_object_vars($key) as $field => $value) {

			$where[] = $field . ' = ?';
			$condVal[] = $value;

		}

		// set new row values
		foreach (get_object_vars($object) as $field => $value) {
				
			if (is_null($value)) {
				$sets[] = '`' . $field . '` = NULL';
			} else {
				$sets[] = '`' . $field . '` = ?';
				$fieldVal[] = $value;
			}

		}

		// create one list of values to bind
		$values = array_merge($fieldVal, $condVal);

		if (count($sets) and count($where)) {

			// build the SQL query
			$query =
				'UPDATE `' . $table . '`' .
				' SET ' . implode(', ', $sets) .
				' WHERE ' . implode(' AND ', $where);		

			// execute the SQL query
			$res = $this->exec($query, $values);

		} else {
			
			$res = 0;
			
		}
		
		return $res;
		
	}