I am creating a web page that will allow comparisons of MySQL global variables for two or more instances. The user will select the instance's and a php function with use mysqli to get the results. The results will come in the below format:
Array (
[0] => Array ( [VARIABLE_NAME] => activate_all_roles_on_login [host1:3306] => OFF )
[1] => Array ( [VARIABLE_NAME] => admin_address [host1:3306] => 0.0.0.1 )
)
Array (
[0] => Array ( [VARIABLE_NAME] => activate_all_roles_on_login [host1:3307] => OFF )
[1] => Array ( [VARIABLE_NAME] => admin_address [host1:3307] => 0.0.0.1 )
)
Array (
[0] => Array ( [VARIABLE_NAME] => activate_all_roles_on_login [host3:3308] => OFF )
[1] => Array ( [VARIABLE_NAME] => admin_address [host3:3308] => 0.0.0.2 )
)
I am wanting to combine these on the variable name value, like below:
[0] => Array ( [VARIABLE_NAME] => activate_all_roles_on_login [host1:3306] => OFF [host1:3307] => OFF [host3:3308] => OFF )
I've tried using array_combine, but that only made more of a mess.
The end goal of this is to make an array that can be easily turned into a table like below:
