我在mysqli_multi_query
. 哪个执行正确但没有返回任何值。它返回空白。有什么问题mysqli_multi_query
或者有什么替代方法可以在codeigniter中触发多个查询。
$sql="LOCK TABLE xp_subunit WRITE; ";
$sql .= "SELECT @myLeft := ".$_GET['lft'].", @myRight := ".$_GET['rgt'].", @myWidth := ".$_GET['lft']." - lft + 1
FROM xp_subunit
WHERE id =".$_GET['id']."; ";
$sql .= "DELETE FROM xp_subunit WHERE lft BETWEEN @myLeft AND @myRight; ";
$sql .= "UPDATE xp_subunit SET rgt = rgt - @myWidth WHERE rgt > @myRight; ";
$sql .= "UPDATE xp_subunit SET lft = lft - @myWidth WHERE lft > @myRight; ";
$sql.="UNLOCK TABLES;";
//echo $sql;
$query = $this->db->mysqli_multi_query($sql);