Solved

While loop skip first div

Posted on 2010-08-16
1
315 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
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.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now