I'm new at programming. This week I have learned the basics of HTML, CSS, PHP and MySQL and I am making a simple turn-based strategy game to practice coding (and have fun while doing it!).
Now, I usually look on DuckDuckGo and YouTube when I am stuck but this time I can't seem to find an answer to my question. Here it is, hope you can help:
I am making the file that will be a cronjob to update the resources my players have. In table 1 (named stockpile) I have columns called village_id
, wood
, stone
and iron
. In table 2 (named buildings) I have columns called village_id
, woodcutters
, quarry
and mine
. Now here is an example of what I'd like the code to do:
Take 'wood' of village1 and update it like this; wood = wood + (x * woodcutter of village1)
.
I really hope someone can help me! My project is going fine except for this part I can't seem to wrap my head around...