Echoen in rijen van 2?

Gestart doorMarv9 reacties50 weergaven

10 berichten · pagina 1 van 1

Marv

Lid · Topicstarter

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Hallo,
Ik gebruik deze code:

<script type="text/javascript">
    $(function() {
        $(#gallery a).lightBox();
    });
    </script>

    
    </head>
<div id="gallery">
[COLOR= #0000BB]<?php
$getItems[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM krantenknipsels ORDER BY datum"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$getItems[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<center>[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]<br>
    <a href="krantenknipsels/[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" title="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]">

                <img src="krantenknipsels/[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" width="72" height="72" alt="" /></center>

            </a>

[/COLOR][COLOR= #007700];
}[/COLOR]
?>
</div>


Nu wordt alles in 1 rei naar onder weergegeven.

Wie zou voor mij het kunnen maken dat er 2 naatst elkaar staan?

Mvg
0
Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24


$getItems = mysql_query("SELECT * FROM krantenknipsels ORDER BY datum");
while ($item = mysql_fetch_assoc($getItems))
{
echo .$item[titel] .



Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt.



;
}
?>
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Smiegles schreef:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$getItems = mysql_query("SELECT * FROM krantenknipsels ORDER BY datum");
while ($item = mysql_fetch_assoc($getItems))
{
echo .$item[titel] .



Afbeelding niet beschikbaarDe oorspronkelijke afbeelding of link ontbreekt.



;
}
?>

humorist
0
Berichten
21
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
<div id="gallery">
[COLOR= #0000BB]<?php
$getItems[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM krantenknipsels ORDER BY datum"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$getItems[/COLOR][COLOR= #007700]))
{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<center>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]];[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR]is_even[COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<br>"[/COLOR][COLOR= #007700]; }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href="krantenknipsels/"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"" title="""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"">"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<img src="krantenknipsels/"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"" width="72" height="72" alt="" />"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</center></a>"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
</div>
0
Berichten
1.544
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
<script type="text/javascript">
    $(function() {
        $(#gallery a).lightBox();
    });
    </script>

    
    </head>
<div id="gallery">
[COLOR= #0000BB]<?php
$getItems[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM krantenknipsels ORDER BY datum"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$getItems[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<center>[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]<br>
    <a href="krantenknipsels/[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" title="[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]">

                <img src="krantenknipsels/[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]" width="72" height="72" alt="" /></center>

            </a>

[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]%[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700])
{[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++;
}[/COLOR]
?>
</div>
0
Marv

Lid · Topicstarter

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Die van uberdude zegt call tu undefined function is_even

En die van jenner geeft gewoon onder elkaar weer zoals normaal.
0
Berichten
1.544
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Efferinie schreef:
Die van uberdude zegt call tu undefined function is_even

En die van jenner geeft gewoon onder elkaar weer zoals normaal.
Hij hoort het gewoon te doen hoor.

[COLOR= #0000BB]<?php
$array[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]3[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]5[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]6[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]7[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]8[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]9[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]10[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$array[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$string[/COLOR][COLOR= #007700])
{[/COLOR]

    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]-[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]-[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]%[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700])
    {[/COLOR]
    
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
    
    }[/COLOR]
    
    [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++;

}[/COLOR]
?>


Geeft:

-1-
-2-
<br />
-3-
-4-
<br />
-5-
-6-
<br />
-7-
-8-
<br />
-9-
-10-
<br />
0
Berichten
21
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
<div id="gallery">
[COLOR= #0000BB]<?php
$getItems[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM krantenknipsels ORDER BY datum"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$item[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$getItems[/COLOR][COLOR= #007700]))
{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<center>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$cache[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]][/COLOR]/[COLOR= #0000BB]2[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/is_int"]is_int[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$cache[/COLOR][COLOR= #007700])) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<br>"[/COLOR][COLOR= #007700]; }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<a href="krantenknipsels/"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"" title="""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"">"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<img src="krantenknipsels/"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$item[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"" width="72" height="72" alt="" />"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</center></a>"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
</div>
0
Berichten
160
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Efferinie schreef:
Nu wordt alles in 1 rei naar onder weergegeven.
Wie zou voor mij het kunnen maken dat er 2 naatst elkaar staan?
Efferinie schreef:
Nu wordt alles in 1 rij naar onder weergegeven.
Wie zou voor mij het kunnen maken dat er 2 naast elkaar staan?

Misschien moet je eens kijken of je een "spelchecker plugin" kan downloaden. Want je hebt in die 2 regels al 2 spelingsfouten.

Moet je het niet met een table doen, dan is het wat netter uitgelijnd.
0
Marv

Lid · Topicstarter

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Martijnn schreef:
Eerdere citaten tonen
Efferinie schreef:
Nu wordt alles in 1 rei naar onder weergegeven.
Wie zou voor mij het kunnen maken dat er 2 naatst elkaar staan?
Eerdere citaten tonen
Efferinie schreef:
Nu wordt alles in 1 rij naar onder weergegeven.
Wie zou voor mij het kunnen maken dat er 2 naast elkaar staan?

Misschien moet je eens kijken of je een "spelchecker plugin" kan downloaden. Want je hebt in die 2 regels al 2 spelingsfouten.

Moet je het niet met een table doen, dan is het wat netter uitgelijnd.
Ga wat nuttigs doen man.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren