Miscellany
public text v1 · immutable
# timeline checker
# $time_s time start
# $time_e time end
# $factor is how pricis it should be
my $sql = "SELECT COUNT(*), $time_s+$factor FROM tv_log
WHERE $time_s BETWEEN UNIX_TIMESTAMP(`time_start`) AND UNIX_TIMESTAMP(`time_end`)
AND $time_s+$factor BETWEEN UNIX_TIMESTAMP(`time_start`) AND UNIX_TIMESTAMP(`time_end`)
AND `channel` LIKE '$$data2{'channel'}'";