my code works perfect for some data and for other it returns object data type where it should return array of arrays..
Here is my code and queries
$ma