Multi-column display _php tutorial for single database field in PHP

Source: Internet
Author: User

Single database field multi-column display in PHP


This article mainly introduces a single database field in PHP display of multiple columns, branch display skills, can also be called one-page pagination, horizontal output, the need for friends can refer to the next

Today in the project, encountered a problem is to read from the database of the same field branch display, that is, each row shows 12 columns, according to the total number of records to control the number of loops. If the multi-field is very good implementation, a loop, if it is a field loop so it is more troublesome, need to use multiple loops and incremental variables, there are many online phper encounter similar problems, today's small series to share their solutions.

For the same field loop multiline and control column display number, the principle is to first use limit to read out the first loop, and then take the first loop read the number of records and the number of columns to display each row. The following code is directly attached:

First Loop code:

 
  "/>
 
  
 
  

after the Loop code:

 
   
 
  "/>
 
  
 
  
 
  

Of course, there are more direct methods, that is, the first cycle of multiple loops, only need to change the limit of the first parameter. Hope for beginners phper helpful.

http://www.bkjia.com/PHPjc/852821.html www.bkjia.com true http://www.bkjia.com/PHPjc/852821.html techarticle Single database field multi-column display in PHP this article mainly introduces the single database field in PHP, multi-column display, branch breakdown display skills, also known as one-piece page pagination, horizontal output, need ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.