我有3个表(event_csv,TimeSlots和FilledSlots)。我必须检查'配额'是否代表总共没有座位和$ filledpositions(没有填充席位)然后我想按照第一次显示的未填充行的顺序排序'event_csv'表中的行
SELECT csv_id,description,Location_description,Jobdate FROM event_csv WHERE Jobdate = '$event';
SELECT ID, Quota, StartTime, EndTime FROM TimeSlots WHERE EventID='. $row[csv_id] . ';
$filledquery = 'SELECT ID FROM FilledSlots WHERE TimeSlotID=' . $filled[ID];
$filledresult = mysql_query($filledquery) or die(mysql_error());
$filledPositions = mysql_num_rows($filledresult);
event_csv表包含以下字段
1 csv_id int(11)
2 TaskId int(12)
3 description varchar(32)
4 super char(32)
5 LocId int(8)
6 Location_description varchar(32)
7 Jobdate date
8 Jobtime time
9 Duration time
10 PersonsReq int(2)
11 tshirt varchar(3)
12 counted int(1)
TimeSlots表包含以下字段
1 ID int(11)
2 Date date
3 Quota int(11)
4 EventID int(11)
5 SlotName varchar(64)
6 StartTime time
7 EndTime time
8 beer_hours int(2)
FilledSlots表有以下字段
1 ID int(11)
2 TimeSlotID int(11)
3 EventID int(11)
4 VolName varchar(80)
5 VolEmail varchar(150)
6 VolPhone varchar(15)
7 Shirt_Size varchar(32)
8 Approved tinyint(1)
9 Time_slot time
10 beer_hours int(2)