SMGames
08-01-2007, 08:47 AM
Hi i am trying to delete a user from the online users when they close the browser, this is how i have done it:
<?php
if(@$_SESSION['Loggedin'] == 'false'){
$result = mysql_query("DELETE FROM online_users WHERE loginname='".$_SESSION['loginname']."'")
or die(mysql_error());
$row = mysql_fetch_array( $result ) }
?>
But im getting this error:
Parse error: syntax error, unexpected '}'
when users login it inserts there username into the online users, and when they logout it deletes it, but i am having trouble when the user doesnt logout and just closes the browser.
Or if anyone has any other ideas on how to create an online user system, i would like to hear them.
<?php
if(@$_SESSION['Loggedin'] == 'false'){
$result = mysql_query("DELETE FROM online_users WHERE loginname='".$_SESSION['loginname']."'")
or die(mysql_error());
$row = mysql_fetch_array( $result ) }
?>
But im getting this error:
Parse error: syntax error, unexpected '}'
when users login it inserts there username into the online users, and when they logout it deletes it, but i am having trouble when the user doesnt logout and just closes the browser.
Or if anyone has any other ideas on how to create an online user system, i would like to hear them.