Benodigheden lijst

Gestart doorShahiem16 reacties24 weergaven

17 berichten · pagina 1 van 2

Shahiem

Lid · Topicstarter

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

Ik ben een benodigheden lijst en die streept de spullen af die je hebt gekocht. Maar nog niet bij alle. Maar ik wil niet zo veel ifs op een pagina.

Kan dat ook op een andere manier?

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/config.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/header.php[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ingelogd [COLOR= #007700]==[/COLOR] true[COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$ledenQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT
                                            toverstok
                                        FROM
                                            leden
                                        WHERE
                                            id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ledeninfo[COLOR= #007700][[/COLOR][COLOR= #DD0000]eigen[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]);[/COLOR]
                                        
    [COLOR= #0000BB]$ledenFetch[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ledenQuery[/COLOR][COLOR= #007700]);[/COLOR]    
    
    [COLOR= #0000BB]$bezittingQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT
                                            id,
                                            artikel_id
                                        FROM
                                            gekochte_spullen
                                        WHERE
                                            lid_id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ledeninfo[COLOR= #007700][[/COLOR][COLOR= #DD0000]eigen[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]);[/COLOR]
                                        
    [COLOR= #0000BB]$bezittingFetch[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$bezittingQuery[/COLOR][COLOR= #007700]);[/COLOR]                            
    
    [COLOR= #0000BB]$BenodighedenQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT
                                            id,
                                            artikel_id
                                        FROM
                                            benodigheden
                                        WHERE
                                            artikel_id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$bezittingFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"
                                        "[/COLOR][COLOR= #007700]);[/COLOR]    
                                        
    [COLOR= #0000BB]$BenodighedenFetch[/COLOR]  [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$BenodighedenQuery[/COLOR][COLOR= #007700]);[/COLOR]                            
    ?>
            U N I F O R M<br /><br />

        1. <s>Drie effen werkgewaden (zwart)</s><br />
        2. En effen puntmuts (zwart) voorm schooltijd<br />
        3. En paar beschermde handschoenen (drakenhuid of soortgelijk)<br />
        4. En wintermantel (zwart, met zilveren speld)<br />
        N.B.: Alle kledingstukken moeten van naamlabels zijn voorzien<br /><br />

        V E R P L I C H T E   L E C T U U R<br />
        Alle leerlingen moeten in het bezit zijn van de volgende werken:<br /><br />

        Het Standaard Spreukenboek (Niveau 1) Door Miranda Wiggelaar<br />
        De Geschiedenis van de Toverkunst door Mathilda Belladonna<br />
        Theoretische Grondslagen der Magie door Adalbert Zwatel<br />
        Gedaanteverwisselingen: een Boek voor Beginners door Emeric Morfo<br />
        Duizend Magische Kruiden en Paddestoelen door Philippa Zwam<br />
        Magische Brouwsels en Drankjes door Arsenius Grein<br />
        Fabeldieren en Waar Ze Te Vinden door Newt Scamander<br />
        De Zwarte Kunsten: Een Handboek voor Zelfbescherming door Quinten Tondel<br /><br />

        O V E R I G E   B E N O D I G D H E D E N<br /><br />
        [COLOR= #0000BB]<?php[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ledenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]toverstok[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700])
            {[/COLOR]
        ?>
        1 toverstok<br />
        [COLOR= #0000BB]<?php[/COLOR]
        [COLOR= #007700]}[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<s>1 toverstok</s><br />[/COLOR][COLOR= #007700];
        }[/COLOR]
        ?>
        1 ketel (tin, standaardmaat 2)<br />
        1 set glazen of kristallen flesjes<br />
        1 telescoop<br />
        1 set koperen weegschalen<br />
        Leerlingen mogen tevens een uil of een kat of een pad meenemen.<br /><br />

        Ouders worden er aan herinnerd dat eerstejaars geen eigen bezemstelen mogen bezitten.
        [COLOR= #0000BB]<?php[/COLOR]        
    
[COLOR= #007700]}[/COLOR]

[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/footer.php[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik denk niet dat het anders kan dan veel ifs gebruiken. Wat is er eigenlijk zo erg aan?

Je zou overigens ook overal zoiets kunnen doen:
echo $a == $b ? lala : blabla;
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dankjewel luuk biggrin
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Met switch ofzo.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Shahiem schreef:
Dankjewel luuk biggrin
Graag gedaan biggrin
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kan je nog met 1 ding helpen, hij doorstreept alleen artikel id 9 maar de andere ids niet confused.
Hoe kan dat?

Code:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/config.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/header.php[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ingelogd [COLOR= #007700]==[/COLOR] true[COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$ledenQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT
                                            toverstok
                                        FROM
                                            leden
                                        WHERE
                                            id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ledeninfo[COLOR= #007700][[/COLOR][COLOR= #DD0000]eigen[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]);[/COLOR]
                                        
    [COLOR= #0000BB]$ledenFetch[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ledenQuery[/COLOR][COLOR= #007700]);[/COLOR]    
    
    [COLOR= #0000BB]$bezittingQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT
                                            id,
                                            artikel_id
                                        FROM
                                            gekochte_spullen
                                        WHERE
                                            lid_id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ledeninfo[COLOR= #007700][[/COLOR][COLOR= #DD0000]eigen[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]);[/COLOR]
                                        
    [COLOR= #0000BB]$bezittingFetch[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$bezittingQuery[/COLOR][COLOR= #007700]);[/COLOR]
    
    
    [COLOR= #0000BB]$BenodighedenQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT
                                            id,
                                            artikel_id
                                        FROM
                                            benodigheden
                                        WHERE
                                            artikel_id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$bezittingFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"
                                        "[/COLOR][COLOR= #007700]);[/COLOR]    
                                        
    [COLOR= #0000BB]$BenodighedenFetch[/COLOR]  [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$BenodighedenQuery[/COLOR][COLOR= #007700]);[/COLOR]
    
    ?>
    <h1>Benodighedenlijst</h1>
        <div id="contentgedeelte">
            U N I F O R M<br /><br />

            1. Drie effen werkgewaden (zwart)<br />
            [COLOR= #0000BB]<?php[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]47[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]2. <s>E&eacute;n effen puntmuts (zwart) voorm schooltijd</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]2. E&eacute;n effen puntmuts (zwart) voorm schooltijd<br />[/COLOR][COLOR= #007700];[/COLOR]
            ?>
            3. E&eacute;n paar beschermde handschoenen (drakenhuid of soortgelijk)<br />
            4. E&eacute;n wintermantel (zwart, met zilveren speld)<br />
            N.B.: Alle kledingstukken moeten van naamlabels zijn voorzien<br /><br />

            V E R P L I C H T E   L E C T U U R<br />
            Alle leerlingen moeten in het bezit zijn van de volgende werken:<br /><br />

            [COLOR= #0000BB]<?php[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]46[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Het Standaard Spreukenboek (Niveau 1) Door Miranda Wiggelaar</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Het Standaard Spreukenboek (Niveau 1) Door Miranda Wiggelaar<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]47[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>De Geschiedenis van de Toverkunst door Mathilda Belladonna</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]De Geschiedenis van de Toverkunst door Mathilda Belladonna<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]48[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Theoretische Grondslagen der Magie door Adalbert Zwatel</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Theoretische Grondslagen der Magie door Adalbert Zwatel<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]49[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Gedaanteverwisselingen: een Boek voor Beginners door Emeric Morfo</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Gedaanteverwisselingen: een Boek voor Beginners door Emeric Morfo<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]50[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Duizend Magische Kruiden en Paddestoelen door Philippa Zwam</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Duizend Magische Kruiden en Paddestoelen door Philippa Zwamd<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]51[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Magische Brouwsels en Drankjes door Arsenius Grein</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Magische Brouwsels en Drankjes door Arsenius Grein<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]52[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Fabeldieren en Waar Ze Te Vinden door Newt Scamander</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Fabeldieren en Waar Ze Te Vinden door Newt Scamander<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]53[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>De Zwarte Kunsten: Een Handboek voor Zelfbescherming door Quinten Tondel</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]De Zwarte Kunsten: Een Handboek voor Zelfbescherming door Quinten Tondel<br />[/COLOR][COLOR= #007700];[/COLOR]
            ?>

            O V E R I G E   B E N O D I G D H E D E N<br /><br />
            [COLOR= #0000BB]<?php[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ledenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]toverstok[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700])
                {[/COLOR]
            ?>
            1 toverstok<br />
            [COLOR= #0000BB]<?php[/COLOR]
            [COLOR= #007700]}[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<s>1 toverstok</s><br />[/COLOR][COLOR= #007700];
            }[/COLOR]
            ?>
            1 ketel (tin, standaardmaat 2)<br />
            1 set glazen of kristallen flesjes<br />
            1 telescoop<br />
            1 set koperen weegschalen<br />
            Leerlingen mogen tevens een uil of een kat of een pad meenemen.<br /><br />

            Ouders worden er aan herinnerd dat eerstejaars geen eigen bezemstelen<br /> mogen bezitten.<br /><br />
        </div>
        <div id="contentbot"></div>
        [COLOR= #0000BB]<?php[/COLOR]        
    
[COLOR= #007700]}[/COLOR]

[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/footer.php[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Waar staat die nummer 9 dan?
En waarom heb je eigenlijk .$lala die . ervoor staan? Dat hoeft namelijk niet emo
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Die nummer 9 komt uit de tabel Benodigheden.
En ja die ga ik weg halen yummie
EDIT:

Weet het al, ik had bij die echo de teksten omgekeerd gezet. yummie (Ohnee toch nietconfused)
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Op deze manier checkt ie volgens mij maar 1 ding, je zult denk ik een while moeten gebruiken voor alle artikelen en in die while checken of de user het al heeft
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Welke query? Want als ik de 1e doe dan verdubbelt alles en als ik de 2e doe dan doet ie nog steeds niks.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik denk dat je de query $BenodighedenQuery in de while moet doen
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lukt ook nietsadley
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/config.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/header.php[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ingelogd [COLOR= #007700]==[/COLOR] true[COLOR= #007700])
{[/COLOR]
    [COLOR= #0000BB]$ledenQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"
    SELECT
        toverstok
    FROM
        leden
    WHERE
        id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ledeninfo[COLOR= #007700][[/COLOR][COLOR= #DD0000]eigen[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]
    );[/COLOR]
    
    [COLOR= #0000BB]$ledenFetch[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ledenQuery[/COLOR][COLOR= #007700]);[/COLOR]    
    
    [COLOR= #0000BB]$user_haz[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
    
    [COLOR= #0000BB]$bezittingQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"
    SELECT
        id,
        artikel_id,
        (
            SELECT
                1
            FROM
                gekochte_spullen
            WHERE
                artikel_id = b.artikel_id
        ) user_haz
    FROM
        benodigheden b
    WHERE
        lid_id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ledeninfo[COLOR= #007700][[/COLOR][COLOR= #DD0000]eigen[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]
    );[/COLOR]
    
    [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$bezittingFetch[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$bezittingQuery[/COLOR][COLOR= #007700]))
    {[/COLOR]
        
        [COLOR= #0000BB]$user_haz[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$bezittingFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]] =[/COLOR] [URL="http://www.php.net/is_null"]is_null[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$bezittingFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user_haz[/COLOR][COLOR= #007700]]) ?[/COLOR] false [COLOR= #007700]:[/COLOR] true[COLOR= #007700];
        
    }[/COLOR]
?>
    <h1>Benodighedenlijst</h1>
        <div id="contentgedeelte">
            U N I F O R M<br /><br />

            1. Drie effen werkgewaden (zwart)<br />
            2. [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$user_haz[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]47[/COLOR][COLOR= #007700]] ==[/COLOR] true [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR] ?>E&eacute;n effen puntmuts (zwart) voorm schooltijd[COLOR= #0000BB]<?[/COLOR]php [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$user_haz[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]47[/COLOR][COLOR= #007700]] ==[/COLOR] true [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]</s>[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR] ?><br />
            3. E&eacute;n paar beschermde handschoenen (drakenhuid of soortgelijk)<br />
            4. E&eacute;n wintermantel (zwart, met zilveren speld)<br />
            N.B.: Alle kledingstukken moeten van naamlabels zijn voorzien<br /><br />

            V E R P L I C H T E   L E C T U U R<br />
            Alle leerlingen moeten in het bezit zijn van de volgende werken:<br /><br />

            [COLOR= #0000BB]<?php[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]46[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Het Standaard Spreukenboek (Niveau 1) Door Miranda Wiggelaar</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Het Standaard Spreukenboek (Niveau 1) Door Miranda Wiggelaar<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]47[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>De Geschiedenis van de Toverkunst door Mathilda Belladonna</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]De Geschiedenis van de Toverkunst door Mathilda Belladonna<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]48[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Theoretische Grondslagen der Magie door Adalbert Zwatel</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Theoretische Grondslagen der Magie door Adalbert Zwatel<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]49[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Gedaanteverwisselingen: een Boek voor Beginners door Emeric Morfo</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Gedaanteverwisselingen: een Boek voor Beginners door Emeric Morfo<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]50[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Duizend Magische Kruiden en Paddestoelen door Philippa Zwam</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Duizend Magische Kruiden en Paddestoelen door Philippa Zwamd<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]51[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Magische Brouwsels en Drankjes door Arsenius Grein</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Magische Brouwsels en Drankjes door Arsenius Grein<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]52[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>Fabeldieren en Waar Ze Te Vinden door Newt Scamander</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]Fabeldieren en Waar Ze Te Vinden door Newt Scamander<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$BenodighedenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artikel_id[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]53[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>De Zwarte Kunsten: Een Handboek voor Zelfbescherming door Quinten Tondel</s><br />[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000]De Zwarte Kunsten: Een Handboek voor Zelfbescherming door Quinten Tondel<br />[/COLOR][COLOR= #007700];[/COLOR]
            ?>

            O V E R I G E   B E N O D I G D H E D E N<br /><br />
            [COLOR= #0000BB]<?php[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ledenFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]toverstok[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700])
                {[/COLOR]
            ?>
            1 toverstok<br />
            [COLOR= #0000BB]<?php[/COLOR]
            [COLOR= #007700]}[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<s>1 toverstok</s><br />[/COLOR][COLOR= #007700];
            }[/COLOR]
            ?>
            1 ketel (tin, standaardmaat 2)<br />
            1 set glazen of kristallen flesjes<br />
            1 telescoop<br />
            1 set koperen weegschalen<br />
            Leerlingen mogen tevens een uil of een kat of een pad meenemen.<br /><br />

            Ouders worden er aan herinnerd dat eerstejaars geen eigen bezemstelen<br /> mogen bezitten.<br /><br />
        </div>
        <div id="contentbot"></div>
        [COLOR= #0000BB]<?php[/COLOR]        
    
[COLOR= #007700]}[/COLOR]

[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/footer.php[/COLOR][COLOR= #007700];[/COLOR]
?>


Voor dat hele rijtje van

cho .$BenodighedenFetch[artikel_id] == 46 ? <s>Het Standaard Spreukenboek (Niveau 1) Door Miranda Wiggelaar</s><br /> : Het Standaard Spreukenboek (Niveau 1) Door Miranda Wiggelaar<br />;


enz. moet je hetzelfde doen als bij

2. [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$user_haz[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]47[/COLOR][COLOR= #007700]] ==[/COLOR] true [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]<s>[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR] ?>E&eacute;n effen puntmuts (zwart) voorm schooltijd[COLOR= #0000BB]<?[/COLOR]php [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$user_haz[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]47[/COLOR][COLOR= #007700]] ==[/COLOR] true [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]</s>[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR] ?><br />


Alleen moet je dan dus $user_haz[nummer_hiero] doen
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het werkt al, Luuk yummie
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ow emo
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