Jump to content

Need to change array structure


unemployment

Recommended Posts

This while loop

 

while (($row = mysql_fetch_assoc($result)) !== false)
{
$data[] = $row;
}

    return $data;
}

returns

 

Array
(
    [0] => Array
        (
            [u_count] => 
            [c_count] => 6
            [b_count] => 
            [pm_count] => 
        )

    [1] => Array
        (
            [u_count] => 
            [c_count] => 
            [b_count] => 0
            [pm_count] => 
        )

    [2] => Array
        (
            [u_count] => 
            [c_count] => 
            [b_count] => 
            [pm_count] => 0
        )

)

 

and I want all of these arrays merged.  How can I do this?

Link to comment
https://forums.phpfreaks.com/topic/238388-need-to-change-array-structure/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.