PHP vraagje

Gestart doorTmeiland4 reacties36 weergaven

5 berichten · pagina 1 van 1

Tmeiland

Lid · Topicstarter

Berichten
450
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

ik haal een image uit de database maar ik wil dat na elke 2e query dus
  • komt en als ik dit doe:

    <li>
    <a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" rel="lightbox-gallery" title="Spackspuitwerk"><img src="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" width="200" height="150" alt="" /></a>
    </li>
    <li class="nomargin">


    dan werkt mijn slide niet ik moet t zo fixxe

    <li>
    <a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" rel="lightbox-gallery" title="Spackspuitwerk"><img src="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" width="200" height="150" alt="" /></a>
    </li>
    
    <li>
    <a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" rel="lightbox-gallery" title="Spackspuitwerk"><img src="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" width="200" height="150" alt="" /></a>
    </li>
    
    <li class="nomargin">


    dus dat wilt zeggen na elke 2e querie de
  • weergeven zoals dit:

    http://pastebin.com/mJBmzqth

    code:

    [COLOR= #0000BB]<?php
    $result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM upload"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]))
    {[/COLOR]
            
    ?>
    
    <li>
    <a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" rel="lightbox-gallery" title="Spackspuitwerk"><img src="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" width="200" height="150" alt="" /></a>
    </li>
    <li class="nomargin">
    
    [COLOR= #0000BB]<?php[/COLOR]
    [COLOR= #007700]}[/COLOR]
    ?>


    Bedankt, als iemand mij kan helpen sorry kan t niet beter uitleggenyummie
    Groet, Tim
  • 0
    Leax

    Lid

    Berichten
    347
    Reputatie
    0
    Punten
    0,00
    Lid sinds
    Laatst gezien
    Dus je wil dat hij 2x iets uit de database haalt, en dan die zin plaatst &dan weer verder gaat?
    0
    Tmeiland

    Lid · Topicstarter

    Berichten
    450
    Reputatie
    0
    Punten
    0,00
    Lid sinds
    Laatst gezien
    Ja, ik wil bv

    Dat die

    1e uit db haalt:

    <li>
    <a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" rel="lightbox-gallery" title="Spackspuitwerk"><img src="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" width="200" height="150" alt="" /></a>
    </li>


    2e uit db haalt:

    <li>
    <a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" rel="lightbox-gallery" title="Spackspuitwerk"><img src="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" width="200" height="150" alt="" /></a>
    </li>


    Dan dit:

    <li class="nomargin">


    1e uit db haalt:

    <li>
    <a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" rel="lightbox-gallery" title="Spackspuitwerk"><img src="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" width="200" height="150" alt="" /></a>
    </li>


    2e uit db haalt:

    <li>
    <a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" rel="lightbox-gallery" title="Spackspuitwerk"><img src="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" width="200" height="150" alt="" /></a>
    </li>


    Dan dit:

    <li class="nomargin">


    enzo steeds door..

    dus na elke 2e ding die hij uit haalt uit db

    dan dit
    <li class="nomargin">


    dan weer doorgaan 2 uit db en dan weer dit
    <li class="nomargin">


    etc etc

    Hopelijk snappen jullie t nu
    0
    Leax

    Lid

    Berichten
    347
    Reputatie
    0
    Punten
    0,00
    Lid sinds
    Laatst gezien
    Probeer dit eens?

    [COLOR= #0000BB]<?php
    $aQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM upload"[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]<=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$aQuery[/COLOR][COLOR= #007700]) ) {[/COLOR]
    [COLOR= #0000BB]$bQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM upload WHERE id="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$bFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$bQuery[/COLOR][COLOR= #007700]);[/COLOR]
    ?>
    <li>
    <a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$bFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" rel="lightbox-gallery" title="Spackspuitwerk"><img src="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$bFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" width="200" height="150" alt="" /></a>
    </li>
    [COLOR= #0000BB]<?php[/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]$i[/COLOR]/[COLOR= #0000BB]2[/COLOR][COLOR= #007700])) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<li class="nomargin">[/COLOR][COLOR= #007700];
    }[/COLOR]
    [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++;
    }[/COLOR]
    ?>
    0
    Berichten
    8.602
    Reputatie
    0
    Punten
    0,00
    Lid sinds
    Laatst gezien
    Zo moet werken:

    [COLOR= #0000BB]<?php
     
    $i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]
    
    [COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM upload"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]))
    {[/COLOR]
            
        ?>
    
        <li>
        <a href="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" rel="lightbox-gallery" title="Spackspuitwerk"><img src="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]locatie[/COLOR][COLOR= #007700]];[/COLOR] ?>" width="200" height="150" alt="" /></a>
        </li>
    
        [COLOR= #0000BB]<?php[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]%[/COLOR] [COLOR= #0000BB]3[/COLOR][COLOR= #007700])
        {[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]    <li class="nomargin">[/COLOR][COLOR= #007700];
            
        }[/COLOR]
        
        [COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++;
        
    }[/COLOR]
    
    ?>
    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