blueman378 Posted November 27, 2008 Share Posted November 27, 2008 hi guys, well i have a class called session i also have a class called database in session heres a portion: $this->userinfo = $database->getUserInfoUsername($subuser); $this->username = $_SESSION['username'] = $this->userinfo['username']; $this->userid = $_SESSION['userid'] = $this->userinfo['user_id']; $this->userlevel = $this->userinfo['user_level']; $this->usercookiekey = $this->generateRandID(); $database->updateUserField($this->userid, "user_cookiekey", $this->usercookiekey); $database->addActiveUser($this->userid, time()); now whats happening is the updateUserField function is working perfectly. however the add ActiveUser function is setting 0 as the user id heres both functions: function addActiveUser($usersid, $userstime) { $ip = $_SERVER['REMOTE_ADDR']; $q = "DELETE FROM guests_active WHERE ip='$ip'"; mysql_query($q, $this->connection) or die(mysql_error()); $q = "DELETE FROM users_active WHERE user_id='$usersid'"; mysql_query($q, $this->connection) or die(mysql_error()); $q = "INSERT INTO users_active VALUES ('$usersid', '$userstime', '0')"; mysql_query($q, $this->connection) or die(mysql_error()); $this->calcNumActiveUsers(); } function updateUserField($id, $field, $value) { $q = "UPDATE users SET ".$field." = '$value' WHERE user_id = '$id'"; return mysql_query($q, $this->connection); } so it should be working any ideas why its not? Link to comment https://forums.phpfreaks.com/topic/134502-solved-it-is-set-but-not-sending-right-value/ Share on other sites More sharing options...
blueman378 Posted November 27, 2008 Author Share Posted November 27, 2008 never mind it started working... with no changes... Link to comment https://forums.phpfreaks.com/topic/134502-solved-it-is-set-but-not-sending-right-value/#findComment-700337 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.