Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

While loop skip first div

Posted on 2010-08-16
1
Medium Priority
?
321 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…
Suggested Courses

604 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