PHP interesse |
|
mjah dat is waar ik heb nu dit :
function update_online() {
// Gebruikers ID
$user_id = check_status( 'check' , 'id' );
if ( !$user_id ) {
$user_id = 0;
}
// Kijken of gebruiker al is ingelogd zo ja updaten anders invoegen
$query = mysql_secure_query( "SELECT id FROM user_online WHERE user_id = ?" , $user_id );
if ( mysql_num_rows( $query ) ) {
mysql_secure_query( "UPDATE user_online SET date = ? WHERE id = ?" , nl_time() , mysql_result( $query , 0 , 0 ) );
} else {
mysql_secure_query( "INSERT INTO user_online ( user_id , date ) VALUES ( ? , ? )" , check_status( 'check' , 'id' ) , nl_time() );
}
// Tijd min 5 minuten
$time = nl_time() - 300;
// Mensen die al minder dan 5
mysql_secure_query( "DELETE FROM user_online WHERE date < ?" , $time );
}
function update_online() { // Gebruikers ID $user_id = check_status( 'check' , 'id' ); if ( !$user_id ) { $user_id = 0; } // Kijken of gebruiker al is ingelogd zo ja updaten anders invoegen $query = mysql_secure_query( "SELECT id FROM user_online WHERE user_id = ?" , $user_id ); mysql_secure_query ( "UPDATE user_online SET date = ? WHERE id = ?" , nl_time () , mysql_result( $query , 0 , 0 ) ); } else { mysql_secure_query( "INSERT INTO user_online ( user_id , date ) VALUES ( ? , ? )" , check_status( 'check' , 'id' ) , nl_time() ); } // Tijd min 5 minuten $time = nl_time() - 300; // Mensen die al minder dan 5 mysql_secure_query( "DELETE FROM user_online WHERE date < ?" , $time ); }
|