从PHP运行代码时没有获得上次更新的ID。如果查询在PHPMyAdmin中运行,它将返回上次更新的id
SET @LastUpdateID := 0;
UPDATE ibe_session_pool t1 JOIN
(
SELECT t2.id FROM ibe_session_pool t2
WHERE t2.query_in_progress='0' LIMIT 0,1
)dummy
ON t1.id=dummy.id
SET t1.sequence_number = (CASE
WHEN t1.sequence_number < 999 THEN t1.sequence_number+1
ELSE 1
END),
t1.id = (SELECT @LastUpdateID := t1.id),
t1.query_in_progress='1';
SELECT @LastUpdateID AS LastUpdateID;
$afftectedRows = $this->db->query($queryUpdate);