问问题
1385 次
2 回答
2
那不应该是
SELECT
m.memberID, m.zoneCode, m.state, m.zone, m.countyName,
CONCAT(m.state,'Z',m.zone) as fullZoneCode,
c.state, c.zone, c.countyName
FROM members_zonesToWatch m
LEFT JOIN countyPublicForcastZoneCorrelation c
ON c.zoneCode = CONCAT(m.state, 'Z', m.zone)
于 2012-07-07T05:05:45.920 回答
2
在对您的案例进行测试后,问题'Z'
是$db->query
这是因为当您的语句(从调试器看来,引号变为)时,MysqliDB
内部使用mysqli
并mysqli
引发了异常。prepare
'
'
相反,请MysqliDB
提供rawQuery
像您这样的案例。所以使用下面的:
$result = $db->rawQuery('
SELECT m.memberID, CONCAT(m.state, ? ,m.zone) as fullZoneCode
FROM members_zonesToWatch m
LEFT JOIN countyPublicForcastZoneCorrelation c
ON c.zoneCode = CONCAT(m.state, ? ,m.zone)',
array('Z','Z'));
于 2012-07-14T02:00:02.177 回答