<?php $fieldvalue = PilotData::GetFieldValue($pilot->pilotid, 'IVAO ID');
if($fieldvalue != '')
{
echo '<a href="https://www.ivao.aero/Member.aspx?ID='.$fieldvalue.'">
<img src="http://status.ivao.aero/R/'.$fieldvalue.'.png"></a>';
}
?>
This is the final correct form of the code.