This is the simple snip-it I am using:
<?php
$query = @mysql_query("SELECT * FROM se_accounts ORDER BY equity DESC");
$i=0;
while ($row=@mysql_fetch_array($query)) {
if ($row[other] !== "Y") {
$i++;
}
echo "<tr>
<td align=\"center\">";
if ($row[other] == "Y") {
echo "<font class=\"redtext\">*</font>";
} else {
echo $i;
}
echo "</td>
<td align=\"center\">
{$row[company]}
</td>
<td align=\"center\">";
echo "US\$" . formatNumber($row[equity]);
echo "</td>
</tr>";
}
?>
Here is an example of the output:
Position Company Name Equity
1 Name1 US$99,975.00
* Name2 US$99,975.00
2 Name3 US$111,612.97
3 Name4 US$100,000.00
4 Name5 US$100,000.00
5 Name6 US$100,000.00
It SHOULD be:
Position Company Name Equity
1 Name3 US$111,612.97
2 Name4 US$100,000.00
3 Name5 US$100,000.00
4 Name6 US$100,000.00
5 Name1 US$99,975.00
* Name2 US$99,975.00
Does anyone know what's going wrong? Any help is very much appriciated.
Thank you in advance.