probier mal LEFT OUTER JOIN explizit und nimm az.server_id mal in den select-teil mit auf
ausgabe?
ausgabe?
SELECT
S.*, az.server_id, IF(ISNULL(az.tag_stoerstart_datum),'nicht ausgefallen', az.tag_stoerstart_datum)
FROM
server S
LEFT OUTER JOIN tagesstatus az USING (server_id)
WHERE
az.server_id IS NULL
OR
az.tag_stoerstart_datum>=NOW() - INTERVAL 1 DAY;
SELECT ser_name FROM server WHERE server_id NOT IN
(SELECT server_id FROM tagesstatus WHERE tag_stoerstart_datum >=
DATE_SUB(NOW(), INTERVAL 24 HOUR) AND tag_stoerstart_zeit >= now() );
$abfrage_server = mysql_query("SELECT server_id FROM tagesstatus WHERE tag_stoerstart_datum >= DATE_SUB(NOW(), INTERVAL 24 HOUR)
AND tag_stoerstart_zeit >= now() ");
$data_server = mysql_fetch_array($abfrage_server);
$abfrage_server2 = mysql_query("SELECT ser_name FROM server WHERE server_id NOT IN '$data_server[server_id]' ");
$data_server2 = mysql_fetch_array($abfrage_server2);
echo $data_server2['ser_name'];
$abfrage_server = mysql_query("SELECT server_id
FROM tagesstatus
WHERE tag_stoerstart_datum >= DATE_SUB(NOW(), INTERVAL 24 HOUR)
AND
tag_stoerstart_zeit >= now() ");
while($row=mysql_fetch_array($abfrage_server))
$data_server[]=$row['server_id'];
$sql='SELECT ser_name FROM server';
if (isset($data_server))
$sql.=' WHERE server_id NOT IN ('.implode(',',$data_server).')';
$abfrage_server2 = mysql_query($sql);
while ($data_server2 = mysql_fetch_array($abfrage_server2))
echo $data_server2['ser_name'].'<br />';
Kommentar