laatste reactie

Gestart doorSmiegles4 reacties113 weergaven

5 berichten · pagina 1 van 1

Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
He ,

ik heb dus een database gemaakt waar de gebruikers via datatime geupdate worden en dan komt het er zo in : 2012-02-02 19:28:34

en het word er zo uitgehaald :

$leden = mysql::query("SELECT * FROM leden WHERE tijd_bezocht > (NOW() - INTERVAL 5 MINUTE)")or die(mysql_error());


heeft alleen iemand een idee hoe ik bijvoorbeeld zou kunnen zeggen :

gebruikersnaam Laatste reactie
smiegles 2 minuten 13 seconde

mvg ,

Smiegles
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
In whear systeem staat in de index.php de datenl function, altijd handig.
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$date[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"2012-02-02 19:28:34"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$date[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strtotime"]strtotime[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$date[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$date[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]60[/COLOR][COLOR= #007700]){[/COLOR]
    [COLOR= #0000BB]$min[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ceil"]ceil[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$date[/COLOR]/[COLOR= #0000BB]60[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$sec[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$date[/COLOR][COLOR= #007700]-([/COLOR][COLOR= #0000BB]$min[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]60[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$min[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" minuten "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sec[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" seconde"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$sec[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$date[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sec[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" seconde"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Eleky schreef:
[COLOR= #0000BB]<?php
$date[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"2012-02-02 19:28:34"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$date[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strtotime"]strtotime[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$date[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$date[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]60[/COLOR][COLOR= #007700]){[/COLOR]
    [COLOR= #0000BB]$min[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ceil"]ceil[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$date[/COLOR]/[COLOR= #0000BB]60[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$sec[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$date[/COLOR][COLOR= #007700]-([/COLOR][COLOR= #0000BB]$min[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]60[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$min[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" minuten "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sec[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" seconde"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$sec[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$date[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sec[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" seconde"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
het is seconden wink
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Good For You
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