我尝试使用里程表进行奖励轮询,现在我希望我的号码轮询由零领先, 1,239,387是001,239,387,它从 123456789 开始。当里程表运行时,结果没有 00,只有 1,239,387。此代码我尝试使用 concat 或添加前缀以添加前导零。但如果领先 > 0 它显示
<?php
$query="SELECT
CONCAT('00',MBR_ID) AS MBR_ID,
NAME,
RWD_DESC
FROM RTL.RWD_POLL RWD
JOIN RTL.RWD_HEAD HED ON RWD.RWD_HEAD_NBR = HED.RWD_HEAD_NBR
WHERE HED.ACT_F = 1 AND RWD.DEL_NBR = 0
ORDER BY RWD_POLL_NBR DESC";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$MbrN = $row['MBR_ID'];
$names = $row['NAME'];
$reward = $row['RWD_DESC'];
//$NoUndian = sprintf('%02d',$MbrN);
?>
<script>
setTimeout(function(){
$('.odometer').html(<?php echo $NoUndian; ?> );
}, 1000);
</script>
结果仍然是 1,239,387 没有零。