Online scriptje

Gestart doorMitchels4 reacties25 weergaven

5 berichten · pagina 1 van 1

Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja, nu heb ik ook een vraag
Ik heb dit script:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]../_include.php[/COLOR][COLOR= #007700]);[/COLOR]
design_boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Leden Lijst[/COLOR][COLOR= #007700]);[/COLOR]
check_login[COLOR= #007700]();[/COLOR]
?>
<h2>Leden Lijst</h2>
<table width="100%">
<tr><td><strong>Naam</strong></td><td><strong>Punten</strong></td><td><strong>Uitbetaald cr.</strong></td><td><strong>Uitbetaald &euro;</strong></td><td width="50"><strong>Online</strong></td></tr>
[COLOR= #0000BB]<?
$top2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM `users` WHERE level = 1 ORDER BY kliks DESC"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$top1[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top2[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top1[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]time[/COLOR][COLOR= #007700]] +[/COLOR] [COLOR= #0000BB]300[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]()){[/COLOR]
[COLOR= #0000BB]$actief[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<strong><font color="red">Nee</font></strong>[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$actief[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]<strong><font color="green">Ja</font></strong>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]kliks[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uitbetaald[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$top[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uitbetaald2[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] cent</td><td>[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$actief[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]</td></tr>[/COLOR][COLOR= #007700];
}[/COLOR]
?>
</table>
[COLOR= #0000BB]<?[/COLOR]
design_onder[COLOR= #007700]([/COLOR][COLOR= #DD0000]1[/COLOR][COLOR= #007700]);[/COLOR]
?>


Maar op een een of andere rare manier werkt het niet.
In de tabel users staat een kolom time en een kolom date
Hoe kan ik nu aangeven wie er online was de laatste 5 minuten?
Ohja de tijd wordt al in de db gezet.
M.V.G Mitchel
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Hoezo een kolom date en een kolom time, en niet gewoon een kolom datetime?
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik dacht dat dat makkelijker was emo
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Dat is het niet. cry
Maargoed, werkt zoiets?
SELECT user_id, gebruikersnaam FROM leden WHERE DATE_ADD(laatstonlinedatum, INTERVAL 300 SECOND) > NOW()

Ik zou dr wel een datetime veld van maken, dat werkt echt handiger dan 2 aparte velden.
0
Mitchels

Lid · Topicstarter

Berichten
2.396
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedankt,
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