vendredi 24 avril 2020

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

So im making a web based game similar to Torn City, where there could potentially be millions of users. My issue is regarding user inventories. I started out creating dynamic tables based on each user's id. e.g Table name = [UserID]_Inventory. From what Ive found out this can create a load of hacker friendly entries with sql injections and such because of the dynamic creation. My only other option seems to be creating 1 giant table holding every item that every player has and all the varied details of each item. This seems like it would take longer and longer to load once user count increases and the user's inventory will likely be accessed often. Is there another option? My only idea so far is to create some kind of temporary inventory that grabs only the active player inventories. That helps the database search time issues but still brings me back to creating dynamic tables. At this stage I don't really need coding help, rather I need database structure help. Code is appreciated tho. Cheers.




Aucun commentaire:

Enregistrer un commentaire