heres my code
<?php
if ($temp3 == 0)
{
$val = "0";
$rank = "rank 1";
}
else {
$val = "121";
$rank = "rank 2";
}
$temp4 = "$rank";
// Begin printing data
for($i=0;$i<count($data);$i++) {
$temp1 = $data[$i]['id'];
$temp2 = $data[$i]['name'];
$temp3 = $data[$i]['hour'];
print ("<tr><td>EZY- $temp1</td><td>$temp2</td><td>$temp3</td><td>$temp4</td>");
}
print("</table>");
?>
what im trying to do is get it so that when they php gets the info from the database it check the value of $temp3 which is the amount of hours someone has on their record and if its = or > 0 the text "rank 1" is displayed inteh 4th column of the table ie got on the page and when $temp4 = or > 121 the text "rank 2" is displayed int eh 4th colum but for some reason its assigning rank 1 to all the records can someon etll me where ive gone wrong bearing in ind im not very good with php im taching myself
and yes i have 2 records and yes the 2nd record is = to 121 hours so it should display as rank 2 not rank 1