I have the following snippet of code. I am absolutely sure the the variable, $type, contains the string "401k". I know this because I echo it out right before this snippet of code. However, when the $rate is displayed when it is looping through the records, it makes all $rate records into '$' amounts including if the $type is "401k". That tells me that even though $type is "401k", it is failing on the first check and going into the 'else' condition.
Any suggestions would be great or if more info is needed, I can provide.
<?if ($type != "401k"){
$rate = odbc_result($s_result_deduction, 3);
$c_rate = '$' . number_format($rate, 2, '.', ',');
echo '<td width="5%" align="right"><font size="2" face="Arial, Helvetica, sans-serif">';
echo "$c_rate";
}
else {
$rate = odbc_result($s_result_deduction, 3);
$c_rate = number_format($rate, 2, '.', '') . '%';
echo '<td width="5%" align="right"><font size="2" face="Arial, Helvetica, sans-serif">';
echo "$c_rate";
}
echo "</font></td>";?>
Any suggestions would be great or if more info is needed, I can provide.
<?if ($type != "401k"){
$rate = odbc_result($s_result_deduction, 3);
$c_rate = '$' . number_format($rate, 2, '.', ',');
echo '<td width="5%" align="right"><font size="2" face="Arial, Helvetica, sans-serif">';
echo "$c_rate";
}
else {
$rate = odbc_result($s_result_deduction, 3);
$c_rate = number_format($rate, 2, '.', '') . '%';
echo '<td width="5%" align="right"><font size="2" face="Arial, Helvetica, sans-serif">';
echo "$c_rate";
}
echo "</font></td>";?>