Basically i want to select everything in a table which isn't in another one...
ok, that made more sense in my head.
I have 3 tables, 'days' 'duties' and 'duty_days'
duty_days has duty_id and day_id fields (from the other two tables)
what I want to do is select all the duties which are on the same day_id, then the rest of the duties.
hope this is making sense so far...
currently I have
Code: Select all
SELECT `title`, `duties`.`duty_id` FROM `duties`, `duty_days` WHERE `duty_days`.`day_id` = "' . $d . '" AND `duty_days`.`duty_id` = `duties`.`duty_id` ORDER BY `duties`.`start_time` ASCAny ideas how to do this?
thanks
oh yer `days` just has `name` and `day_id`, eg
monday 1
tuesday 2
wednesday 3
...