Egor_Varaksa Posted March 6, 2022 Share Posted March 6, 2022 How to make 3 lines written to the database, and then they started to be overwritten Example: 06.03.2022\n 05.03.2022\n 04.03.2022 And then the bottom line was deleted and the previous one was written in its place Example: 07.03.2022\n 06.03.2022\n 05.03.2022 Link to comment
Cronoss Posted March 7, 2022 Share Posted March 7, 2022 What it is exactly what you mean? are you using mysql? you should show us the code you need help for so people in the community can help you Link to comment
Egor_Varaksa Posted March 7, 2022 Author Share Posted March 7, 2022 I don't have the code. I want to make it so that when a player logs into an account, the date and time of his login are recorded in the database (internal.db). I want the date to be recorded a certain number of times and then start being overwritten. Let's say a player logged in on 01.03.2022, then he logged in on 02.03.2022, then 03.03.2022, and when he logs in on 04.03.2022, the date 01.03.2022 is deleted Link to comment
Moderators Citizen Posted March 7, 2022 Moderators Share Posted March 7, 2022 If you want to do that, I'd suggest you create another table that will store all players connection dates. Check this DB fiddle I made for you that does exactly what you want (pure SQL with the help of triggers) https://dbfiddle.uk/?rdbms=sqlite_3.27&fiddle=a9ffcada462d8d1dff443bc0a1cf874d Ask any question. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now