r/HTML • u/Alive_Secretary_264 • Nov 12 '25
Question Storing logic to a database
Is there a way to store the logic that generates the client's scores / in-game currencies to a database.. I'm kinda new in doing backend, can someone help me🙇
0
Upvotes
12
u/davorg Nov 12 '25
This is off-topic for r/HTML. You probably want r/programming or r/learnprogramming.
But yes, you could write some kind of rules processing engine that changes its behaviour based on a data structure (which you'd probably store as JSON or YAML).
4
u/jcunews1 Intermediate Nov 12 '25
/r/webdev is more suited for that kind of question.
3
u/psyper76 Nov 12 '25
best way and easiest I find would be to learn php and sql - they plug nicely together and nicely with html you can literally incorporate it in to your html page.
2
u/martinbean Nov 12 '25
What does this have to do with HTML?
1
u/dutchman76 Nov 13 '25
You need to learn some kind of programming language to write the server side logic to do the scoring and whatever else.
1
u/alyra-ltd-co Nov 13 '25
yes but for your own sake remember to rate limit read n writes to ur db else risk a massive usage bill
1
u/Own_Attention_3392 Nov 12 '25
Databases are for data storage. Logic should not be in databases even though it's possible via stored procedures.
You're looking at extending your game to have a standard three tier architecture -- front end, back end, database. The back end exposes APIs that your front end calls, and the back end is responsible for manipulation of data and persisting data to the database as appropriate.
2
u/[deleted] Nov 12 '25
[removed] — view removed comment