// $SQL= "SELECT User.Nick, Schichtplan.*, Schichtbelegung. * FROM User LEFT JOIN Schichtplan ON User.UID=Schichtbelegung.UID, Schichtplan.SID LEFT JOIN Schichtbelegung.SID WHERE User.UID = Schichtbelegung.UID AND Schichtplan.SID = Schichtbelegung.SID AND Schichtplan.Date < now() and Schichtplan.EndDate > now() ORDER BY Nick";
"JOIN Schichtbelegung ON User.UID=Schichtbelegung.UID ".
"WHERE Schichtplan.SID = Schichtbelegung.SID AND ".
"Schichtplan.Date < now() and ".
"Schichtplan.EndDate > now() ".
"ORDER BY Nick";
$SQL="SELECT Shifts.*, ShiftEntry.*, User.Nick ".
"FROM User ".
"INNER JOIN (Shifts INNER JOIN ShiftEntry ON Shifts.SID = ShiftEntry.SID) ON User.UID = ShiftEntry.UID ".
"WHERE (Shifts.DateS<=Now() AND Shifts.DateE>=Now() );";
*/
$SQL="SELECT Shifts.*, ShiftEntry.* ".
"FROM Shifts INNER JOIN ShiftEntry ON Shifts.SID = ShiftEntry.SID ".
"WHERE (Shifts.DateS<=Now() AND Shifts.DateE>=Now() );";
//SELECT User.Nick, Schichtplan.*, Schichtbelegung. * FROM User LEFT JOIN Schichtbelegung ON User.UID=Schichtbelegung.UID, Schichtplan LEFT JOIN Schichtbelegung ON Schichtplan.SID = Schichtbelegung.SID WHERE Schichtplan.Date < now() and Schichtplan.EndDate > now() ORDER BY Nick
//echo "<pre>$SQL</pre>";
$Erg=mysql_query($SQL,$con);
$Zeilen=mysql_num_rows($Erg);
// for ($i = 1; $i < mysql_num_fields($Erg); $i++)