Avoid Division by Zero Errors

This commit is contained in:
Andreas Österreicher
2018-07-25 14:09:50 +02:00
parent 8022307972
commit 308b989686
+2 -1
View File
@@ -76,7 +76,8 @@ $ts_beginn=mktime(0,0,0,substr($datum_beginn,5,2),substr($datum_beginn,8,2),subs
$ts_ende=mktime(0,0,0,substr($datum_ende,5,2),substr($datum_ende,8,2),substr($datum_ende,0,4));
$wochen=round(($ts_ende-$ts_beginn)/(60*60*24*7));
if ($wochen == 0)
$wochen = 1;
//Stundenplandaten holen
$sql_query="SELECT DISTINCT datum,stunde,ort_kurzbz, EXTRACT(DOW FROM datum) AS tag, max_person
FROM lehre.".$stundenplantable." JOIN public.tbl_ort USING (ort_kurzbz)