[eluser]drakeonfire[/eluser]
Hello,
Hopefully I'll be able to explain this clearly and what I am trying to achieve, and what I currently have.
There are three tables: tasks, users, tasks_users
A user can have many tasks, and a task can have many users.
In the table "tasks_users" there are 4 columns: id, task_id, user_id, item_date
The problem I am facing is that, if I am user 1 for example, and I am associated with tasks 2,3,4. These can have any item_date they want.
As a task may be done multiple times during a week for example (picture a user dragging tasks onto a calender, the day they are droppd on is what defines the item_date). A user can not do the same task twice on a day (which I have already managed to cover).
However - this should not stop a user doing a task multiple times over several days, e.g. once on day 1, once on day 4.
The problem is, when I try and save this new relationship, it would overwrite the day 1 and just replace the date with the date of day 4.
Essentially the relationship should be able to have multiple rows of the same user_id and task_id, as long as they have different dates.
Any ideas on how I can solve this? I have looked through the user guide at advanced relationships and what-not but can not seem to find anything regarding my issue. Any ideas :-)?
Thank you,
Drake.