Jump to content

Just to clear things up


Deanznet

Recommended Posts

Hey I'm trying to make a game.. Keyword Trying lol

 

 

I just need to clear something up..

 

If i have 3 different kinds Quality of  item.. Some Items Will be Bronze Type Some Will Be Silver and Some Will be gold

 

I also want it so when they first start playing they get to buy a pack Bronze Pack, Silver Pack, Gold Pack, That will pick 3 random items from what ever pack they buy and give it to them.

 

So how do i set up my mysql database for this?

 

Will it just be One table called Shop Items and than have the item id and item quality and what ever else that i put in their like the desc.

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/79028-just-to-clear-things-up/
Share on other sites

You're best bet is to make 1 table.  Consisting of the following (plus whatever else u might add):

itemId

ItemColor (referring to the bronze, silver gold)

itemName

itemDesc

and so on...

 

Then when you need random items from say the silver pack, you can have your script grab the list of all silver items and store them in an array.  Then just generate random numbers of zero through the size of the array.  That's how I would go about it personally.  Others probably have easier methods.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.