I have following query to update database. But it's not complete.
1.) If FORUM_MEMBERS.M_AGE value is empty that user will be added to all forums's access list. Big problem. =)
2.) If user is exist in FORUM_ALLOWED_MEMBERS table, this query duplicates FORUM_ID for that MEMBER_ID. Another problem.
3.) I want if M_AGE is (ie) 10, that user should see forums where M_SUBJECTs are 7,8,9,10,11,12,13 (I mean +3 and -3)
4.) This query should be processed for members that registered after a special date.
If u can help about one of these, thank you in advance!..
INSERT INTO
FORUM_ALLOWED_MEMBERS
(
Member_ID,
Forum_ID
)
SELECT
FORUM_MEMBERS.Member_ID,
FORUM_FORUM.Forum_ID
FROM
FORUM_MEMBERS
INNER JOIN
FORUM_FORUM ON FORUM_FORUM.F_SUBJECT LIKE '%' + FORUM_MEMBERS.M_AGE + '%'