$time1 = "08:30";
$time2 = "16:30";
$result = ("SELECT * FROM history
left join tb_user on history.userID = tb_user.userID
where timejob NOT BETWEEN '$time1' and '$time2'
order by historyID ASC");
$time1 = "08:30";
$time2 = "16:30";
$result = ("SELECT * FROM history
left join tb_user on history.userID = tb_user.userID
where timejob NOT BETWEEN '$time1' and '$time2'
order by historyID ASC"); // ตรงนี้ mysql_query() หายไปไหนครับ
while($row = mysql_fetch_array($result))
{
echo $row['history.historyID'] . " " . $row['tb_user.m_fname'];
echo "<br>";
}
?>