sql

SQL Command Reference

Deactivate all inactive users in the last year:
UPDATE `smf_members` SET `is_activated` = 0, `validation_code` = `dateRegistered` WHERE (UNIX_TIMESTAMP() - `lastLogin`) / 86400 >= 365 AND (UNIX_TIMESTAMP() - `dateRegistered`) / 86400 >= 365;

Search and replace text in the "body" field (note that it must be updated in 2 places):
UPDATE smf_messages SET body = replace(body,'OLD','NEW');
Append a value to a field, if it's not already present: