How does the data queried by mysql multiple tables generate model return values like TP? is there such a library?

ask everyone for advice!

return value after multi-table query

< table > < thead > < tr > < th align= "left" > id < / th > < th align= "right" > name < / th > < th align= "center" > age < / th > < th > xingqu < / th > < / tr > < / thead > < tbody > < tr > < td align= "left" > 1 < / td > < td align= "right" > Zhang San < / td > < td align= "center" > 12 < / td > < td > Sing < / td > < / tr > < tr > < td align= "left" > 1 < / td > < td align= "right" > Zhang San < / td > < td align= "center" > 12 < / td > < td > drink < / td > < / tr > < tr > < td align= "left" > 2 < / td > < td align= "right" > Li Si < / td > < td align= "center" > 22 < / td > < td > Sing < / td > < / tr > < / tbody > < / table >

is there a library that automatically returns the queried data to the following data format?


[
[id=>1,name=>"",age=>12,xingqu=>["",""]]
[id=>2,name=>"",age=>12,xingqu=>[""]]
]

is there any similar library file? it"s hard to write this without your own model, not to mention querying 3 tables

.
Php
Apr.27,2021

this highly customized requirement is basically not handled by any class library, and it is very simple and can be done by itself.
you think it's much more convenient to be familiar with sql and php data processing if you don't have to write in the orm framework.
can also write the methods in model.

Menu