Multi-column display of single database fields in PHP (One-field pagination, horizontal output), multi-column Paging _php tutorial

Source: Internet
Author: User
Tags php database

Multi-column display of single database fields in PHP (One-field pagination, horizontal output), Multi-column paging


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:

"/><?php echo $inf [' Ei_employeename ']?><?php}?>
after the Loop code:
"/><?php echo $inf [' Ei_employeename ']?><?php}?><?php}?>

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.


PHP database field is the date and time type, PHP paging display time is the same, too long, how to display only the date does not show the time

I recommend that you save the time () function to the second, the Data table field type int (10) can be, the output can be directly with the date (' y-m-d ', db[' time ') format output!

PHP output specified field segment contents in MySQL Database

Database Connection section omitted

$q = mysql_query ("Select User,tel from Darkit. Users limit ", $lnk);
while ($rs = Mysql_fetch_assoc ($q)) {
echo $rs [' User '], ': ', $rs [' Tel '], '
";
}

///////

http://www.bkjia.com/PHPjc/851339.html www.bkjia.com true http://www.bkjia.com/PHPjc/851339.html techarticle Single database field multi-column display in PHP (one field pagination, horizontal output), multi-column paging when doing the project today, there is a problem is to read out from the database of the same fields branch points ...

  • 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.