문제

i have field "price" with type Decimals in my mysql database table, the value is 200000.00

but if i fetch in to my website using PHP, it always showing 0.00 i already double check and make sure my query and fetch script correct

is there a specific way to fetch decimal to php ?

This is my code

$query_price = mysql_query("SELECT * FROM `tblpricing` WHERE `relid`='2' AND `currency`='1'");
  $fetch_price = mysql_fetch_array($query_price);
  $priceun = "$fetch_price[annually]";

thank you

도움이 되었습니까?

해결책

try this

print(number_format($price, 2));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top