开发者

PHP session tracking technique and database design and organization

开发者 https://www.devze.com 2023-03-31 09:01 出处:网络
I am creating a mining calculator for a game called \"eve\". In \"eve\", there are 46 different types of ore that can be mined.In my interface I have a list of players that you can select from to add

I am creating a mining calculator for a game called "eve".

In "eve", there are 46 different types of ore that can be mined. In my interface I have a list of players that you can select from to add members to a mining op and a list of ore that you can add to there op.

Every time you click a member, that member is highlighted using jquery toggle and an ajax request is sent to a php script with that members id that adds that member to a database table which contains the the op_id and the members that belong to it. After this that mining op table is queried for the members that belong to it and that list is returned back to the user creating a table of users in the op. As of rite now when the database is queried for the members that belong to the mining op a table is generated that contains all 46 types of ore along with a text box contained in its own td. At the time of generation of the table, all 46 types of ore that are in the table have the style of display: none attached to them. After the table with all its members and all of the ore that they can mine is returned the user can select the type of ore that they will be using. When a person clicks on an ore type from the ore list a similar toggle event is fired where the ore type is highlighted in the list and the corresponding table header and td that belongs to each user is displayed. This gives the illusion that the specified type of ore was added to the op.

What I would like to be able to do is be able to track the type of ore that belongs to a specific op like I track the members who belong to the op. I am looking for a good way to store in the database a list of ore that is being used on a specific op. So that I may instead of returning all types of ore hidden and unhiding as ore is selected just have them added to the database as they are selected so that when i generate the table, I am not only selecting the members but the ore that has been selected as well.

The part that I cannot figure out is a good way store the list of ore that belongs to the specific op to the database.

Should I store the list in a CSV type setup? or is there some method of storing lists like this in a database. Mind you, the method i am using to store the users could probably use the same method that the ore will use but as of now i have the user table setup where the op_id is in one column with the member_id in another column. This causes the op_id to be repeated many times and I think this is probably wrong.

Thank you in advance for any suggestions or concepts that I could reference to organize this database a little better.

NOTE: I am not looking for a solution to my issue but rather a concept that I may apply that will help me 开发者_Python百科create a better solution.


Hmmmm.... What about a database to track the ops with each column being the amount of times that ore has been used on that op (and other relevant info such as op name and whatnot). XML might be an idea, but it depends on how many ops you have.

NO CSV!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号