specifically around the variables "$mysql_session_start_date" and $mysql_session_end_date" but they are not used for "$qual" and "time_diff"
$query = "SELECT session_id, title, DATE_FORMAT(DATE_ADD(scheduled_time, INTERVAL $time_diff HOUR), '%m/%d/%y %l:%i%p'), teacher,username, DATE_FORMAT(DATE_ADD(time_started, INTERVAL $time_diff HOUR),'%m/%d/%y %l:%i%p'), DATE_FORMAT(DATE_ADD(time_finished, INTERVAL $time_diff HOUR),'%m/%d/%y %l:%i%p') from session,user where session.teacher=user.userid and user.type='T' and session.scheduled_time>='$mysql_session_start_date' and session.scheduled_time<='$mysql_session_end_date' $qual order by scheduled_time ";
I understand that it is building a sql statement but to use the less than with session.scheduled_time and '$mysql_session_start_time'
$mysql_session_start_time had to be in SINGLE quotes. Why were quotes necessary at all? then why were single quotes instead of double?
they weren't used when refering to $qual or for $time_diff.
why not?
$query = "SELECT session_id, title, DATE_FORMAT(DATE_ADD(scheduled_time, INTERVAL $time_diff HOUR), '%m/%d/%y %l:%i%p'), teacher,username, DATE_FORMAT(DATE_ADD(time_started, INTERVAL $time_diff HOUR),'%m/%d/%y %l:%i%p'), DATE_FORMAT(DATE_ADD(time_finished, INTERVAL $time_diff HOUR),'%m/%d/%y %l:%i%p') from session,user where session.teacher=user.userid and user.type='T' and session.scheduled_time>='$mysql_session_start_date' and session.scheduled_time<='$mysql_session_end_date' $qual order by scheduled_time ";
I understand that it is building a sql statement but to use the less than with session.scheduled_time and '$mysql_session_start_time'
$mysql_session_start_time had to be in SINGLE quotes. Why were quotes necessary at all? then why were single quotes instead of double?
they weren't used when refering to $qual or for $time_diff.
why not?