I receive value from a DB $row['jackpot'] it is equal to 5000.00
$row['jackpot']
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.
jackpot
<
if statement
$row_jackpot = (float)$row['jackpot']; if ($row_jackpot < 2000.00) { $asd = 2000.00 - $row_jackpot; echo "To participate you are missing".$asd; }
报告相同问题?
程序员都在用的中文IT技术交流社区
专业的中文 IT 技术社区,与千万技术人共成长
关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!