Aantal badges tellen

Gestart doorMarvinn5 reacties29 weergaven

6 berichten · pagina 1 van 1

Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi.

Ik ben bezig met een nieuw systeem voor mijn website, ik zoek een soort scriptje dat het volgende doet.

Ik klik op de badge (http://www.website.nl/?p=badge&a=394)
En dat hij in de database in tabel badges zoekt naar het id 394 en zoekt hoeveel er bestaat.

En het volgende wil ik dan hebben: Aantal keer gekocht (Stel hij staat 53x in de db) : 51 keer

Hoop dat iemand me verder kan helpen

Groetjes
Marvin.
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[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 gekocht WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]a[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
    [COLOR= #0000BB]$aNums[/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]

    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Aantal keer gekocht: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$aNums[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] [/COLOR][COLOR= #007700];[/COLOR]
?>


Iets in die richting werkt wel denk ik.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Bijna:

[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 gekocht WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]a[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
    [COLOR= #0000BB]$aNums[/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]

    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Aantal keer gekocht: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$aNums[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] [/COLOR][COLOR= #007700];[/COLOR]
?>
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oeps, inderdaad.
Snelheidsfoutje yummie
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik dacht dat je wel wist hoe je mysql_num_rows moest gebruiken?
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedankt het werkt! 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