Good day. In order not to load you with unnecessary information, in brief and with examples, I will describe what the problem is. The fact is that I get some data from the MySQL database. The problem is that they need to be brought to a certain type of array, and I can’t even imagine how.
We have a table in the database and all the cells that correspond to a particular group. For example, a group with ID number 1 should be placed in one associative array.
An example of this label:
Here is an example of an array of this:
$data = array( array( 'modname' => 'Lorem', 'pricing' => array( '0' => 0.03, '1' => 0.15, '2' => 0.50 ), 'names' => array( '0' => 'Lorems +0.03', '1' => 'Ipsum +0.15', '2' => 'Dolor +0.50' ) ), array( 'modname' => 'Ipsum', 'pricing' => array( '0' => 0.08, '1' => 0.20, '2' => 0.60 ), 'names' => array( '0' => 'Sie +0.08', '1' => 'A +0.20', '2' => 'Mat +0.60' ) ) ); So, there is not even a presentation yet on how this can be implemented in the code. How so cells on certain ID Group to place in an array? You can use if-else, but how to do it all in an array?
I hope for your help.
UPD: I will add a small example for a better understanding:
Imagine the store, it has a product - beds.
There is a price for a bed, but there are "modifiers" that affect the price. For example: bed size, bed color, the placement of additional shelves. The point is to somehow pull values from the database and group them by ID. Those. colors to colors, shelves to shelves, sizes to sizes. And it is necessary to group all this in an associative array, as in an example.

'Lorem','Ipsum') selected for the elements of themodnamearray? Especially since in the table the meaning of'Lorem'not in principle ... - Akina