您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

mysql-sprintf_s 问题,求助

2024/6/27 18:55:29发布34次查看
mysqlvs2008sprintf_s
组装一条mysql语句:
sprintf_s(strsql, insert into twifibox_runninglogs values
(null,'%u', '%s', from_unixtime('%u'), '%.1f', '%.1f', '%d', '%d', null)\r\n,
deviceid, roomid, time(null), (float)pth->s16curroomtemp/10,
(float)pth->s16trgroomtemp/10, pth->u8warmstate, pth->workmode);
日志打印:
insert into twifibox_runninglogs values (null,'589923834', '232985fa',
from_unixtime('1439538081'), '0.0', '0.0', '1077215232', '0', null)
from_unixtime('%u') 后面的全部错误,调试跟踪了:
pth->s16curroomtemp = 252
pth->s16trgroomtemp = 350
pth->u8warmstate = 0
pth->workmode = 1
看了很多遍,没发现有不妥的地方,参数都对齐了,求帮助
time(null) 不能直接用,得先用临时值保存?或者%u的格式用错了?
但是其他地方同样的用法又没出错
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product