Werte aus Formularfeld in Datenbank schreiben

Vielen Dank BestShopPossible und derwunner!!!

Mein erstes Plugin steht und funktioniert. @derwunner: das Thema mit Doctrine’s DBAL etc. schaue ich mir nochmal genauer an. Irgendwie hat es jetzt doch mit der Registrierung des Events auf die einfache Weise geklappt. Die Abfrage mit dem Request ist aber super und kann ich bestimmt ein andern mal verwenden. Danke auch dafür!

Mein tpl ->

{extends file="parent:frontend/account/profile.tpl"}

{block name="frontend_account_profile_profile_input_lastname"}
    {$smarty.block.parent}


    {block name="frontend_account_profile_profile_input_JwAccountAddress"}
        {s name='ProfilePersonalJwAccountAddress'}{/s}
        
            
        
    {/block}

{/block}

Meine JwAccountAddress.php File

?php
namespace JwAccountAddress;
use Shopware\Components\Plugin;
use Shopware\Components\Plugin\Context\InstallContext;
/**
 * A simple plugin that shows the usage of attributes in the frontend.
 *
 * @package JwAccountAddress
 */
class JwAccountAddress extends Plugin
{
    /**
     * @param InstallContext $context
     * @return bool
     */
    public function install(InstallContext $context)
    {
        $service = $this->container->get('shopware_attribute.crud_service');
        $service->update('s_user_attributes', 'accountaddress', 'string', [
            'label' => 'AccountAddress',
            'displayInBackend' => true
        ]);

        return true;
    }
    /**
     * @return array
     */
    public static function getSubscribedEvents()
    {
        return [
            'Enlight_Controller_Action_PostDispatchSecure_Frontend' => 'onFrontendPostDispatch',
            'Enlight_Controller_Action_Frontend_Account_saveProfile' => 'saveTransactionAction',
         ];

    }


    /**
     * @param \Enlight_Controller_ActionEventArgs $args
     */
    public function onFrontendPostDispatch(\Enlight_Controller_ActionEventArgs $args)
    {
        $view = $args->getSubject()->View();
        $view->addTemplateDir($this->getPath() . '/Resources/views');
    }


    public function saveTransactionAction(\Enlight_Event_EventArgs $args)

    {

        $userId = Shopware()->Session()->sUserId;

        $view = $args->getSubject()->View();
        $userId = $view->getAssign('sUserData');

        $userId = Shopware()->Session()->sUserId;
        $postData = $args->getSubject()->Request()->getPost();
        $acad = $postData['accountaddress'];

        $sqlAccount = 'UPDATE s_user_attributes SET accountaddress = ? WHERE userID = ?';
        Shopware()->db()->query($sqlAccount,array($acad, $userId));


    }

   
}