我有以下MySQL表...
userid - foreign key
date - primary key
slot1 - 1st free slot
slot2 - 2nd free slot
slot3 - 3rd free slot
slot4 - 4th free slot
slot5 - 5th free slot
slot6 - 6th free slot
slot7 - 7th free slot
slot8 - 8th free slot
所有的时间段都是同一天的,因此用户可以输入他有空的不同时间。
现在我已经做到了,并且它也起作用了,但是现在我遇到了一个问题。我为一个用户输入了一些数据,现在当我尝试为另一个用户输入同一天的数据时,无法进行,因为它已经存在了。
我该如何使同一用户能够输入多个日期,同时另一个用户也可以输入相同的日期?但是同一用户不能输入相同的日期两次……怎么做呢?