【发布时间】:2012-05-02 19:36:55
【问题描述】:
我有这个 sql 查询..
select i.invoiceid as transactionid, i.date, i.total,
'invoice' as transaction_type
from invoice
我在 php 中运行它并在 foreach 循环中回显总数,就像这样......
echo gettype($row['total']) . "<br/>";
所有总数返回string
如何将我的 sql 查询中的 i.total 转换为 int 或 float?
我试过了
convert(int, i.total)
那没用:(
【问题讨论】:
标签: php sql floating-point int