Handle using UNIQUE keys; if SQL query fails (db() function throws), handle it as a duplicate username / email.