Ok,
Here's the story, I'm setting up an instant messenging php script on my website. Everything is up and running properly accept for one thing.
When a new user registers the script writes to the the database the username and password. It also changes the status to "yes"
When you return and go to the login page the script is supposed to automatically delete any previous chatdata and change the status to "no" so the user can login.
Well for some reason I cannot get the script to reset the user status to "no" So basically what you end up with is a one time registery, and a soon as you close that session you'll get an error generated when someone is trying to login with the same user name that an online user is already using.
Here's a copy of the logout script, if you can see any problems, or might know why this is happeing I would greatly appreciate some help.
if($user)
{
$query="update users set status=\"no\" where username=\"$user\"";
$result=mysql_query($query, $link);
$query="delete from chatdata where sender like '%$user%'or buddy like '%$user%'";
mysql_query($query, $link);
print"<center><body bgcolor=\"000066\"><span style=background-color:8080C0><font color=lightblue> $user you have logged out </span>";
exit;
thanks
Chris