Nummers uit database hale?

Gestart doorAdmir5 reacties41 weergaven

6 berichten · pagina 1 van 1

Admir

Lid · Topicstarter

Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb een tabel tracks, en nou wil ik op site zetten hoeveel tracks er in totaal zijn.
Afbeelding

Weet iemand wat de code is, om records uit databases te halen?

Thanks alvast.thumbsup
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(id) AS aantal_tracks FROM track"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$assoc[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$assoc[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantal_tracks[/COLOR][COLOR= #007700]];[/COLOR]
?>
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Zoiets?
[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(1) AS aantal FROM track"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er zijn [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aantal[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] tracks[/COLOR][COLOR= #007700];[/COLOR]


edit:
of die van erik clown
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heb ik toch. emo
0
Admir

Lid · Topicstarter

Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thanks alle bij effe eens proberensmile
Edit: Thanks hij doet t
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Erik schreef:
Heb ik toch. emo
Die van lennard die doet niet id maar gewoon 1 (dan slecteerd hij in princiepe niets =])
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