How do I output the array from the database in a specific format?

blunted and can't solve a problem with the output in the array.
There is a mysql table with fields ID and TITLE
It is necessary to withdraw the array in the format
$param=array('1'=>"consumables", '2'=> 'paint', '3'=>"order");

how is it implemented?
June 10th 19 at 14:58
3 answers
June 10th 19 at 15:00
In a loop:
$param[$row['id']] = $row['title'];
June 10th 19 at 15:02
1. Get an associative array from the query.
2. Next, using array_column() get the desired column title with the key id.

Or even at the stage of obtaining an associative array using the option proposed Exploding in his reply.
June 10th 19 at 15:04
SELECT id, title FROM table WHERE id < 4

Find more questions by tags ArraysMySQL