How to get Signatures for Forums using SQL query?
Please try the following.

if ($account-&gt;id() &amp;&amp; isset($form_state['values']['user_signature'])) {
    if (!$account-&gt;get('user_signature')-&gt;isEmpty()) {
      db_merge('user_signature')
        -&gt;key(array('uid' =&gt; $account-&gt;id()))
        -&gt;fields(array(
          'signature__value' =&gt; $account-&gt;get('user_signature')-&gt;value,
          'signature__format' =&gt; $account-&gt;get('user_signature')-&gt;format,
        ))
        -&gt;execute();
    }
    else {
      db_delete('user_signature')
        -&gt;condition('uid', $account-&gt;id())
        -&gt;execute();
    }
  }