Simple PHP code
Hai all..
What is wrong with my code. When i run it, it doesn't go to the else statement. Can anyone help me..please...
$sql2="SELECT * FROM FRAUD_OPTION WHERE MERCHANT_ID = '" .$merchantid. "'";
$rs2=odbc_exec($conn,$sql2);
if (odbc_fetch_row($rs2) == 0)
{
echo "<td><input type='checkbox' name='chkfraud$No' value=$FraudID></td>";
echo "</tr>";
}
else
{
while (odbc_fetch_row($rs2))
{
$fraud=odbc_result($rs2,"FRAUD_ID");
if ($fraud == $FraudID)
{
echo "<td><input type='checkbox' name='chkfraud$No' value=$FraudID checked></td>";
echo "</tr>";
}
else
{
echo "<td><input type='checkbox' name='chkfraud$No' value=$FraudID></td>";
echo "</tr>";
}
}
}
|