I fired the following query with the help of mysqli_multi_query. Which is executing properly but not returning any value. It returning blank. Whats wrong with the mysqli_multi_query or is there any alternative for this for firing multiple queries in 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);
Just Try with the following Example.,
I think this may help you to get the solution.