cómo enviar matriz de matriz utilizando JSON

Tengo una función que me trae algunos datos de la base de datos y publicaciones a mi cliente. En el momento en que envía datos como una matriz normal (la salida es algo así como MyArray (a, b, c, d ..)), pero quiero que sea MyArray (a (b, c, d)). Castegory (Nombre, ID, Orden ...) .. ¿Puede alguien por favor Ayuda? Aquí está mi código para la versión ya usada

public function get_button_template()
    {
        $this->q = "SELECT * FROM button_template ORDER BY order_number ASC";
        $this->r = mysql_query($this->q);
        if(mysql_num_rows($this->r) > 0)
        {        
            while($this->f = mysql_fetch_assoc($this->r))
            {
                $this->buttons[$this->i]["ID"] = $this->f["ID"];          
                $this->buttons[$this->i]["name"] = $this->f["button_name"];               
                $this->buttons[$this->i]["category"] = $this->f["button_category"];
                $this->buttons[$this->i]["order_number"] = $this->f["order_number"]; 
                $this->i++;
            }
        }
        return $this->buttons;
    }

EDITAR Un poco más de detalle, por favor ... cuando analicé esto obtengo algo como esto:

"Vaule"( "Key1": "Value1" "Key2": "Value2" .

Pero lo que quiero es algo como

 `"Category0":( "Key1": "Value1", "Key2": "Value2" . ) 

"Category1":( "Key1": "Value1", "Key2": "Value2" . )..`

¿Cómo puedo enviar una matriz multidimensional con pares clave-valor?