Jump to content

Recommended Posts

Hi basically when the user requests to log off i want this to send a note to the db saying what time you have logged off but nothing appears in the db. Please help!

Code:

<?php 
include "banner.php";
include "config.php"; 
echo "<center>"; 
if(isset($_GET['logout'])) { 
$times = date("i");
$timeh = date("H");
$time = floor($times);
$time = "$timeh:$times";
$logtime = $time;
$logdate = date("d/m/y");
echo $logged[username];
$logmeout = mysql_query("UPDATE thebusinesstycoon SET logouttime = '$logtime' WHERE '$logged[username]' = 'username'")or die(mysql_error());
$logmeout2 = mysql_query("UPDATE thebusinesstycoon SET logoutdate ='$logdate' WHERE '$logged[username]' = 'username'")or die(mysql_error());
unset($_SESSION['id']); 
unset($_SESSION['password']); 
echo '<img src="http://www.rasclerhys.com/thebusinesstycoon/logout.gif">You have been successfully Logged Out. Click <a href="http://www.rasclerhys.com/thebusinesstycoon/">Here</a>to return to the homepage.'; 
} 
echo "</center>"; 
include"footer.php";
?> 
</body>
</html>

 

Please note the db is connected properly and that is done in config.php but i have tried it and the db does connect just not for the one i want it to lol.

Thanks

-RascleRhys.com

Link to comment
https://forums.phpfreaks.com/topic/147594-solved-help/
Share on other sites

Thanks King Philip :)

And too premisco why does it not make sense, i did it my way and it worked perfectly just like all the other times it has ?!

 

Well why are you using the user's name as a field in your table....that really makes no sense to me, instead of just having a field called username and storing it there.

 

Anyhow, if KingPhilip's worked, then yea that is how your table is designed. Weird, but I guess it works for you.

Link to comment
https://forums.phpfreaks.com/topic/147594-solved-help/#findComment-774846
Share on other sites

Thanks King Philip :)

And too premisco why does it not make sense, i did it my way and it worked perfectly just like all the other times it has ?!

 

Well why are you using the user's name as a field in your table....that really makes no sense to me, instead of just having a field called username and storing it there.

 

Anyhow, if KingPhilip's worked, then yea that is how your table is designed. Weird, but I guess it works for you.

 

His table setup is fine, he was just doing:

value = column instead of column = value like we are used to seeing

Link to comment
https://forums.phpfreaks.com/topic/147594-solved-help/#findComment-774851
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.