select wa.username, wa.password, wa.email, ws.imap_addr, ws.imap_port, ws.server_id, ws.smtp_addr, ws.neat_name, (select type from webmail_serv_types where ws.server_type = type_id) as type, (select type from webmail_auth_types where ws.auth_type = type_id) as auth_type from webmail_user_accounts wa, webmail_servers ws where wa.account_id = :account_id and wa.user_id = :uid and ws.server_id = wa.server_id select nav_bar from webmail_user_prefs where user_id = :uid update webmail_user_accounts set active_p = :active_p where account_id = :account_id and user_id = :user_id select server_id, host_addr, host_append_p from webmail_servers where server_id = :server_id select account_id from webmail_user_accounts where server_id = :server_id and user_id = :user_id and username = :username insert into webmail_user_accounts (account_id, user_id, server_id, email, username, password, active_p) values (:account_id, :user_id, :server_id, :email, :username, :password, 'f')