You would need to add the message within a conditional region, then.
You could have your recordset at the top - just as you describe - then warp your message with conditional PHP code like this:
<?php
if ($row_tasks['alertshow'] < 1) { ?>
Then insert whatever you want to happen here when that condition is met.
<?php } ?>
Regards,
Brian