Sanırım böyleydi:

echo '<td width="100"><p align="center"><br>x'; if($row[req3need] < $row[req4need]) echo '<font color="red">'; else echo '<font color="green">'; echo $row[req3need]; echo'</font></p></td>';