I receive value from a DB
$row['jackpot']
it is equal to 5000.00
how to write the correct condition?
if ($row['jackpot'] < '2000.00') {
$asd = "2000.00" - $row['jackpot'];
echo "To participate you are missing".$asd;
}
I receive value from a DB
$row['jackpot']
it is equal to 5000.00
how to write the correct condition?
if ($row['jackpot'] < '2000.00') {
$asd = "2000.00" - $row['jackpot'];
echo "To participate you are missing".$asd;
}
What is the data type of jackpot
column? If it is string then you need to make it float, only then <
operator will be work in if statement
.
$row_jackpot = (float)$row['jackpot'];
if ($row_jackpot < 2000.00) {
$asd = 2000.00 - $row_jackpot;
echo "To participate you are missing".$asd;
}