我在我的控制器中有功能,将值发布到php,当使用http.post()发布十进制值时,php将其作为一个圆值。如何将十进制值接收到php变量中。
update.js
$scope.updatemyinterest=function(){
$http.post("php/updateMYINTEREST.php",{'INTR1':$scope.intr1,
'INTR2':$scope.intr2,
'AMNTPERGRAM':$scope.intrstamnt
})
console.log($scope.intrstamnt)//2521
console.log($scope.intr1)//2.5
console.log($scope.intr2)//2.33
}
update.php
<?php
include "connectdb.php";
$data=json_decode(file_get_contents("php://input"));
$INTR1=$dbhandle->real_escape_string($data->INTR1);
$INTR2=$dbhandle->real_escape_string($data->INTR2);
$AMNTPERGRAM=$dbhandle->real_escape_string($data->AMNTPERGRAM);
$query1="UPDATE myinterest SET INTR1='$INTR1',INTR2='$INTR2',AMNTPERGRAM='$AMNTPERGRAM' ";
$dbhandle->query($query1);