How to display database records in the view without repeating a field?

后端 未结 2 753
独厮守ぢ
独厮守ぢ 2021-01-22 18:57

In my database I have two tables one politics (politics_id, politics, politics_type_id) and other tipo_politics (politics_type_id, politics_type).
This is the table

2条回答
  •  情深已故
    2021-01-22 19:27

    It looks like you want the headers to be displayed only when there's a change in politics_type. This would require keeping a track of its value in every iteration and the logic can thus be constructed as follows:

    
    
            

    The layout of the

    s above may or may not be exactly as you need, but hopefully it should give an idea on how to use the new $previous_politics_type variable.

提交回复
热议问题