我在这里有这个问题:
$result = "SELECT forma.*, SMS_MONTIME.IDTICKET, SMS_MONTIME.MBYLLUR,SMS_MONTIME.time_added
FROM forma
LEFT JOIN SMS_MONTIME ON forma.ID = SMS_MONTIME.IDTICKET WHERE forma.data_fillim >= '".$df."' AND forma.data_fillim <= '".$dm."' ORDER BY forma.id DESC";
我收到这样的错误: 从字符串转换datetime时,onversion失败。,SQL状态
现在如果我打印$ dm和$ df我得到:
20130621;20130621;
如果我这样说的话,查询工作正常:
$result = "SELECT forma.*, SMS_MONTIME.IDTICKET, SMS_MONTIME.MBYLLUR,SMS_MONTIME.time_added
FROM forma
LEFT JOIN SMS_MONTIME ON forma.ID = SMS_MONTIME.IDTICKET WHERE forma.data_fillim >= '20130621' AND forma.data_fillim <= '20130621' ORDER BY forma.id DESC";
有人请帮忙.. 感谢
答案 0 :(得分:1)
在进行SQL字符串的连接时,您是否尝试转换 $ dm 和 $ df ,ToString()?