TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-12-2008, 06:25 AM   #1 (permalink)
The Wanderer
 
Join Date: Jun 2008
Posts: 8
Thanks: 1
TexasMd91 is on a distinguished road
Default What is the best way to structure this database?

I am helping a friend building a site for a MMO to come up with drop rates or rare items from killing monsters. I want this database to be fully dynamic.

There needs to be a way to store monsters, and items.
How I currently have it is a table called 'monsters' with columns 'id' and 'name'. I then have a table called 'items' with columns 'id' and 'name'. These 2 databases will store all the Possible Monsters that people can kill, and every drop they could receive.

Now there needs to be a table for the logs. I use a table named 'drops' with columns 'id', 'monster_id', and 'item_id'. Only problem is that monsters can drop more then 1 item at a time. So how can I arrange it?

I was thinking of making item_id a string with it being something like 1-19|2-1|91-90| (first number being the quantity, second being the item_id, and then splitting the array 2 times to find out how much of each drop). Is there an easier way to do this?

Last edited by TexasMd91 : 07-02-2008 at 05:28 AM.
TexasMd91 is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:14 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design