Solved

While loop skip first div

Posted on 2010-08-16
1
316 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
1 Comment
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 500 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

776 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