| @@ 12-19 (lines=8) @@ | ||
| 9 | class Online |
|
| 10 | { |
|
| 11 | ||
| 12 | public static function setOnlineStatus($userId) |
|
| 13 | { |
|
| 14 | $connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); |
|
| 15 | $query = "Update login set login_status = 1 where login_id = '$userId'"; |
|
| 16 | if(!$connect->query($query)); |
|
| 17 | echo $connect->error; |
|
| 18 | $connect->close(); |
|
| 19 | } |
|
| 20 | ||
| 21 | public static function removeOnlineStatus($userId) |
|
| 22 | { |
|
| @@ 21-28 (lines=8) @@ | ||
| 18 | $connect->close(); |
|
| 19 | } |
|
| 20 | ||
| 21 | public static function removeOnlineStatus($userId) |
|
| 22 | { |
|
| 23 | $connect = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); |
|
| 24 | $query = "Update login set login_status = 0 where login_id = '$userId'"; |
|
| 25 | if(!$connect->query($query)); |
|
| 26 | echo $connect->error; |
|
| 27 | $connect->close(); |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||