$query="Select t1.field1, sum(t1.field2), t2.field1, t2.field2 FROM t1, t2 WHERE t1.field1 = t2.field1 GROUP BY t1.field1, t2.field1";
$query = mysql_query($query) or die(mysql_error());
$my_row = mysql_fetch_assoc($query);
//Now, the if else is not working here
if (t2.field2 == '2') {
echo "<strike>$my_row[t1.field1]</strike>";
} else {
echo $my_row['t1.field1'];
}