How do I set the value of the output variable to multiple results?

now use phpmailer to make a program that automatically sends mail when it comes to time. There is a requirement that there will be name duplicates in the database, but the class will not repeat. If you need to detect name duplicates in the output variable, there are multiple class, in the result variable and link to the home page on different teacher.

Database:
name class teacher
lee C1 Gebilaowang
lee C2 Gebilaozhang

message content:
Dear% name%, your course has% class%, teacher is% teacher%

the actual experience effect is:
Dear lee, your course has C1PowerC2, and the teacher is Gebilaowang,Gebilaozhang

.

messages are linked to personal pages on each teacher, such as
% teacher%
, but if you use GROUP_CONCAT, it becomes
gebilaowang,gebilaozhang
.

ideal should be
, gebilaozhang

so what do you do with this?
Please give me your advice.

Jan.19,2022

< table > < thead > < tr > < th > name < / th > < th > class < / th > < th > teacher < / th > < / tr > < / thead > < tbody > < tr > < td > lee < / td > < td > C1 < / td > < td > Gebilaowang < / td > < / tr > < tr > < td > lee < / td > < td > C2 < / td > < td > Gebilaozhang < / td > < / tr > < / tbody > < / table >
   

try to output strings like this, and then use string segmentation to split string processing in accordance with the rules to do your own business. For example, if you say you want to jump, you can split the string before the output to replace it.

Menu