- Joined
- Sep 12, 2024
- Messages
- 52
- Solutions
- 1
- Reaction score
- 12
- Points
- 8
Hey guys,
I got something complex that i can't wrap my head around.
I'm trying to retrieve multiple rows from a database table, however the query only returns first entry instead of the entry that's expected.
I'm trying to retrieve 5 of each entries depending column value in the database.
Is there a FetchAll function that I'm missing or is single query the only option? I could do a loop but I need top 15 entries, that would be a loop of 15 to get the data.
Edit
If someone has a better approach or how to handle this here's what I want to accomplish.
When the server launches I want the worldserver to store the retrieved database values, this database values can be stored in project if wanted to so they can be accessed as "prj.GetRanking" or something, what I want to do with this information is whenever the player opens a certain window, the data gets loaded into it.
When new entries that's better than current ranking it replaces it server side, no need to update in the database since the entry gets added there by another query, so whenever the server restarts the correct data would load.
Database structure looks like this
And example that would be
I got something complex that i can't wrap my head around.
I'm trying to retrieve multiple rows from a database table, however the query only returns first entry instead of the entry that's expected.
I'm trying to retrieve 5 of each entries depending column value in the database.
Is there a FetchAll function that I'm missing or is single query the only option? I could do a loop but I need top 15 entries, that would be a loop of 15 to get the data.
Edit
If someone has a better approach or how to handle this here's what I want to accomplish.
When the server launches I want the worldserver to store the retrieved database values, this database values can be stored in project if wanted to so they can be accessed as "prj.GetRanking" or something, what I want to do with this information is whenever the player opens a certain window, the data gets loaded into it.
When new entries that's better than current ranking it replaces it server side, no need to update in the database since the entry gets added there by another query, so whenever the server restarts the correct data would load.
Database structure looks like this
And example that would be
Last edited by a moderator: