Hi I was wondering how to create an array with key value pairs from my other array which is an array consisting of values read in from a DB table.
Heres the code:
$query1 = "SELECT phone, id FROM table1 GROUP BY id";
$result1 = $mysqli->query($query1);
while($rows = $result1->fetch_assoc()) {
}
In order to see the array I used fwrite and var_export
Heres the var_export($row,1):
array('phone' => 123, 'id' => 456)
array('phone' => 246, 'id' => 789)
What am looking for is to create another array using those values to look like this:
array(
123 => 456
246 => 789)