Solved

While loop skip first div

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

708 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

11 Experts available now in Live!

Get 1:1 Help Now