Mysql Query:
select id, ad_click, contact_submit, MONTH(datetime) as months, YEAR(datetime) years from wpxc_leaderboard_counters order by datetime
it's showing result in this way:
Array (
[0] => Array (
[0] => stdClass Object (
[id] => 2 [ad_click] => 0 [contact_submit] => 0 [datetime] => 2019-11-01
)
[1] => stdClass Object (
[id] => 3 [ad_click] => 0 [contact_submit] => 0 [datetime] => 2019-11-01
)
[2] => stdClass Object (
[id] => 4 [ad_click] => 1 [contact_submit] => 0 [datetime] => 2019-11-01
)
[3] => stdClass Object (
[id] => 5 [ad_click] => 0 [contact_submit] => 1 [datetime] => 2019-11-01
)
[4] => stdClass Object (
[id] => 1 [ad_click] => 3 [contact_submit] => 2 [datetime] => 2019-12-06
)
)
)
but wanted to show in this way:
Array (
[0] => Array (
[11] => stdClass Object (
[id] => 2 [ad_click] => 0 [contact_submit] => 0 [datetime] => 2019-11-01
[id] => 3 [ad_click] => 0 [contact_submit] => 0 [datetime] => 2019-11-01
[id] => 4 [ad_click] => 1 [contact_submit] => 0 [datetime] => 2019-11-01
[id] => 5 [ad_click] => 0 [contact_submit] => 1 [datetime] => 2019-11-01
)
[12] => stdClass Object (
[id] => 1 [ad_click] => 3 [contact_submit] => 2 [datetime] => 2019-12-06
)
)
)
Hope this is possible with modifying array as i have used different methods and spent lots of time but nothing achieved yet.