Why are you using HOUR()? Your formats are in hh:mm:ss.
Also you don't need to concatenate simple variables:
"SELECT * FROM subjecschedule WHERE Room='$room' AND `Day`='$day' AND Sem='$sem' AND Schoolyear='$syear' AND LecTimestart < '$lectimestart' OR LecTimeend > '$lectimestart'"
You'll probably need a few brackets at the end of the time comparisons :
"... AND (LecTimestart < '$lectimestart' OR LecTimeend > '$lectimestart')"
sir i think i get it
by using your code
i can trap the time conflict
thank you sir much2x appreciated your kind