Hi,
In mijn Harry Potter game, heb ik een script gemaakt (een tas) waarin je als je spullen hebt staan.
Maar nu zie ik maar 1 item per artikel id, terwijl er delijk wel meer in de tabel staat.
Hoe los ik dit op?
code
In mijn Harry Potter game, heb ik een script gemaakt (een tas) waarin je als je spullen hebt staan.
Maar nu zie ik maar 1 item per artikel id, terwijl er delijk wel meer in de tabel staat.
Hoe los ik dit op?
code
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]_TITLE_[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]Mijn tas[/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]$tasQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT
i.id,
i.artikel_id,
a.naam,
COUNT(1) AS aantal_artikelen
FROM
leden_items i,
winkels_artikelen a
WHERE
i.lid_id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]info[COLOR= #007700][[/COLOR][COLOR= #DD0000]mijn[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"
AND
i.artikel_id = a.id
GROUP BY
i.artikel_id"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]num_rows[COLOR= #007700]([/COLOR][COLOR= #0000BB]$tasQuery[/COLOR][COLOR= #007700]) >=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<table width="100%">
<tr>
<td class="titel">Aantal</td>
<td class="titel">Artikel</td>
</tr>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$tasFetch[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]mysql[COLOR= #007700]->[/COLOR]fetch[COLOR= #007700]([/COLOR][COLOR= #0000BB]$tasQuery[/COLOR][COLOR= #007700]))
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr>
<td></td>
<td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$tasFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td>
</tr>[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</table>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/footer.php[/COLOR][COLOR= #007700];[/COLOR]
?>
Maar ik heb het volgensmij al, maar nu loop ik tegen nog een probleem aan. Hij zegt nu dat ik 2 ratten heb terwijl ik maar 1 heb. 
Hij moet alleen nog het aantal oproepen van de producten.