Multiple columns of a single database field in php are displayed. This article describes how to display multiple columns of a single database field and multiple columns in php. It can also be called single-field paging and horizontal output, multiple columns of a single database field in php are required.
This article mainly introduces the multi-column display of a single database field in php and the display of branch columns. It can also be called single-field paging and horizontal output. For more information, see
Today, when I was working on a project, I encountered a problem: to display the branches of the same field read from the database, that is, to display 12 columns in each row, and to control the number of cyclic rows based on the total number of records. If multiple fields are well implemented, one loop is done. if it is a field loop, it is troublesome. multiple loops and incremental variables need to be used at the same time, there are also many similar problems on the Internet with Phper. today, I will share my solutions with you.
When multiple rows and control columns are cyclically displayed in the same field, the principle is to read the first loop by using Limit, and then add the number of records read in the first loop to the number of columns displayed in each row. The following code is directly attached:
Code for the first loop:
”/>
Loop code later:
”/>
Of course, there is a more direct method, that is, the first loop of multiple cycles, you only need to change the first parameter of Limit. I hope it will be helpful for beginners.
This article introduces the multi-column display and branch-column display techniques of a single database field in php. It can also be called single-field paging and horizontal output...