<br> na 3 records

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Senior, Medior and Junior SAP HANA Developer

Vacature details Vakgebied: Software/IT Opleiding: Medior Werklocatie: Veldhoven Vacature ID: 12696 Introductie Our client is the world's leading provider of lithography systems for the semiconductor industry, manufacturing complex machines that are critical to the production of integrated circuits or chips. Our purpose is “unlocking the potential of people and society by pushing technology to new limits”. We do this guided by the principles “Challenge”, “Collaborate” and “Care”. Wat verwachten we van jou? SAP Certified Application Associate - SAP HANA Cloud Modeling (training and/or certification) Bachelor degree or higher Excellent understanding of SAP HANA (2.0 / Cloud), Data Modelling and writing

Bekijk vacature »

J A

J A

10/03/2008 17:02:00
Quote Anchor link
Ik heb een heel simpel probleem, maar op de een of andere manier krijg ik hem niet opgelost.

Als ik bijv 20 records heb in de database en die allemaal echo. Worden ze allemaal achter mekaar gezet (het zijn plaatjes (alleen de link staat in de db)). Nou wil ik dat er na 3 records (plaatjes) een <br /> komt te staan. Hoe krijg ik dit voor mekaar :s ?
 
PHP hulp

PHP hulp

24/04/2024 22:26:27
 
B a s
Beheerder

B a s

10/03/2008 17:02:00
Quote Anchor link
Door een teller in je while lus op te nemen en als hij op 3 staat een <br /> toe te voegen en de teller te resetten naar 1.
 
PHP Newbie

PHP Newbie

10/03/2008 17:29:00
Quote Anchor link
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
<?php
    for($i = 1; $data = mysql_fetch_assoc($query); $i++)
    {

        echo '<img src="/'.$data['url'].'" />'.(($i % 3 == 0) ? '<br />' : '');
    }

?>
 
Tim

tim

10/03/2008 19:04:00
Quote Anchor link
Je kan ook dit doen, alleen laat je om de 3 zien, dus ik denk dat het voor jou makkelijker is om die van php Newbie te gebruiken.

Maar mijn code:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
<?php
    for($i = 1; $data = mysql_fetch_assoc($query); $i+3)
    {

echo "<br />";
    }

?>
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.