I'll need your help with the following code.
If there is no tickets with the prio_id 5 it should be displayed "ok" and when there one or more tickets with an higher priority it should be a image displayed
<?php
$alert = mysql_query("SELECT count(tn) AS Prio-Tickets FROM ticket where ticket_state_id = 1 AND ticket_priority_id = 5;");
while ($row = mysql_fetch_object($alert))
{
if ($row->Prio-Tickets = 0 )
{
echo 'OK';
}
else
{
echo '<img src="alert.gif"/>'
}
}
?>