Jump to content

[SOLVED] Help!


rascle

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.