?
Solved

While loop skip first div

Posted on 2010-08-16
1
Medium Priority
?
320 Views
Last Modified: 2013-12-13
Hi, i have this code that loops info from db but at the same time it loops a div space in every box i would like it to skip the first div so i don't have a space in top in the first box:
$lineas_query = tep_db_query($lineas_sql);
$i=1;

    while ($lineas = tep_db_fetch_array($lineas_query)){?>
<div id="space">

Open in new window

0
Comment
Question by:jd_18286
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 2000 total points
ID: 33450804
$lineas_query = tep_db_query($lineas_sql);
$i=1;

    while ($lineas = tep_db_fetch_array($lineas_query)){
if ($i==1) {} else {echo '<div id="space">';}
?>
///// $i is incremented somewhere in loop?
0

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question