Question: I have two tables.
Table a id name class number
Table B class no. Chinese class name
In php, I want to display it like this
Software class
Zhang San, Li Si .....
Painting class
Wang Wu ........
How is it reflected in php? In addition, I use smarty.
Reply to discussion (solution)
I have never used smarty. I can find it by using SQL statements. isn't it displayed as expected.
Select. class number, B. chinese class name, group_concat (. name) as name_group from table a left join Table B on. class No. = B. class No. group by. class No.
This makes it easy to query
Select. class number, B. chinese class name, group_concat (. name) as name_group from table a left join Table B on. class No. = B. class No. group by. class No.
This makes it easy to query
Sorry, I mean php can return a two-dimensional array.
I have never used smarty. I can find it by using SQL statements. isn't it displayed as expected.
Can I return a two-dimensional array?
After the association is queried, use an array to process it...
Php array