In a D7 site, I'd like to get all of the user signatures using raw mysql query .
I've found a signature_forum_post
table but could not figure out how to make a query that returns both user.id and signature text, so appreciate your help.
Please try the following.
if ($account->id() && isset($form_state['values']['user_signature'])) {
if (!$account->get('user_signature')->isEmpty()) {
db_merge('user_signature')
->key(array('uid' => $account->id()))
->fields(array(
'signature__value' => $account->get('user_signature')->value,
'signature__format' => $account->get('user_signature')->format,
))
->execute();
}
else {
db_delete('user_signature')
->condition('uid', $account->id())
->execute();
}
}