cdoyle Posted September 9, 2008 Share Posted September 9, 2008 Hi, I have a field in my table that has a Timestamp. It's basically used for when a player is no longer dead in the game. The player is considered dead until current time is great then the timestamp. I was able to get this working and seems to work great. So now to the next part.. I want to give users a way to buy there way out of the hospital. so I'm trying to create an update query to subtract from that timestamp, but I can't seem to get it to work. for a test I'm trying to subtract a set amount. $query = $db->execute("update `players` set `dead_time_remaining`=`dead_time_remaining`-?, where `id`=?", array(120, $player->id)); A timestamp is seconds right? So the 120 would be 120 seconds right? Right now, it's not subtracting anything when I run the query. Link to comment https://forums.phpfreaks.com/topic/123359-subtract-from-timestamp/ Share on other sites More sharing options...
btherl Posted September 9, 2008 Share Posted September 9, 2008 There's some documentation about timestamps here It looks like they are formatted like dates.. Does your query execute succesfully or does it return an error code? Link to comment https://forums.phpfreaks.com/topic/123359-subtract-from-timestamp/#findComment-637124 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.