Generate an associative array from an array of rows using one column as keys and another column as values

Why not just use

$dataarray[$row['id']] = $row['data'];

?

Leave a Comment