If the number of loops is not enough, how can we loop them?
Source: Internet
Author: User
If the number of loops is not enough, how can we loop them ?? Similar to the above, each row of data in the table is cyclically generated. However, if only two rows of data are added, only two rows are Output. The remaining six rows are not displayed at all. How can we make the remaining 6 rows empty to ensure the style normalization of the entire table ?, & Lt ;? If there are not enough php loops, how can we keep them in the loop ??
Similar to the above, each row of data in the table is cyclically generated. However, if only two rows of data are added, only two rows are Output. The remaining six rows are not displayed at all.
How can we make the remaining 6 rows empty to ensure the style normalization of the entire table?
------ Solution --------------------
$ Db-> Query ("list", "select * from # @__ cp where 'pid '= $ row [id] order by 'id' desc ");
$ H = 8; // The number of rows you need
For ($ I = 0; $ I <$ h; $ I ++ ){
If ($ res = $ db-> GetArray ("list ")){
?>
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