CREATING A DYNAMIC ONLINE GALLERY 2. You need (Web site traffic)
CREATING A DYNAMIC ONLINE GALLERY 2. You need to initialize the cell counter outside the loop, so amend the beginning of the loop like this:
‘; $pos++; } ?>
A new loop is added at the end of the existing loop. If there are no more records, and $pos%COLS doesn t equal 0, it means you have an incomplete row at the bot tom of the table, so the second loop continues incrementing $pos while $pos%COLS produces a remainder (which is interpreted as true) and inserting an empty cell. Note that this second loop is not nested inside the first. It runs only after the first loop has ended. 4. Save the page and reload it in a browser. The single row of thumbnails across the top of the gallery should now be neatly lined up two by two, as shown to the right. Try changing the value of COLS and reload ing the page. See how easy it is to control 12 the number of cells in each row by chang ing just one number. You can check your code against gallery_mysql06.php, gallery_mysqli06.php, or gallery_pdo06.php. 331
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.