GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 05-Nov-2005, 05:29
Powerboss Powerboss is offline
New Member
 
Join Date: Nov 2005
Location: Miami, Fl
Posts: 2
Powerboss is on a distinguished road
Unhappy

mysql and asp.


I am building my own game online using .asp format and mysql msaccess database. I currently have members table a masterlist for weapons, armor pieces, misc, and foods. What I'm trying to do next is create a dynamic place in the mysql table a new table for inventories. List the player name then for every column the 15 (maybe more) different types of items a player can have. IE:

Player, weapons, armorhead, armorchest... misc.

I already have it so what the player has equipped on him is in the members table. But I can't figure out how can I make each space where Playername = "blank" that the corrisponding column can hold multiple items by names or some other faster means.

I've been trying to do this with a dynamic array but i still run into the problem of where character in members = character in inventory let players backpack have weapons seperated by ,'s in the table indicate a new weapon. then on the proper page displayed call up each weapon in a dropdown listbox.

I've been trying to get this but nothing has worked so far please help and sorry for all the pseudocoding.
  #2  
Old 05-Nov-2005, 06:01
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 841
admin will become famous soon enough

Database Normalization example. (mysql)


Hello Powerboss,

I am not really sure what you're asking here. For example, what is a "mysql msaccess database"? It's usually one or the other...

Since I didn't quite understand your problem, I'll take a wild guess and assume that you are looking for suggestions to optimise your (database) tables.

If I were you, I'd separate the SUPPLIES from being anywhere inside the MEMBER/PLAYER table. E.g.

Code:
TABLE: PLAYERS ////////////// id | name | etc... -------+------------+------- 001 | jay | .... 002 | terminator | .... 003 | powerboss | .... ... TABLE: SUPPLIES /////////////// id | item -------+--------- 1 | Weapon 1 2 | Weapon 2 3 | Armour 1 4 | Armour 2 5 | Food 1 ... TABLE: PLAYER_SUPPLIES ////////////////////// player_id | supply_id | value ----------+-----------+-------- 001 | 5 | 300 001 | 1 | 1 001 | 2 | 1 003 | 3 | 65 002 | 1 | 1 ...
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #3  
Old 05-Nov-2005, 07:49
Powerboss Powerboss is offline
New Member
 
Join Date: Nov 2005
Location: Miami, Fl
Posts: 2
Powerboss is on a distinguished road
Exclamation

Re: mysql and asp.


What you stated is almost exactly what i was asking. Here's more on it.

Yes I have the stuff seperated. Here's what my tables basically look like.

HTML Code:
<table border =1> <tr><td> Members tables </td></tr> <tr><td> Charactername</td><td>password and ETC...</td><td>inventory the player has equipped by name. </td></tr> <tr><td> Next table masterlists one for weapons, armors, and foods currently </td></tr> <tr><td> item name</td><td>stats on the item.</td><td>and base values and stuff </td></tr> <tr><td> Then Inventory table </td></tr> <tr><td> Character name who it belongs to. </td><td> Then what type of item weapon, helm, chest ETC... whichever category it falls on </td><td> Quantity of each individual item in all columns for all names currently on hand not including what the player has equipped. </td></tr></table>

How do i link these together so a player can carry more than one item in the inventory table such as take what's in inventory weapons for character jay + new weapon if new weapon is not already there and if it is display it as knife(2+) until the player can't hold anymore.

Sorry for the misuse of placing this in a table like that didn't turn out the way i wanted and messed up hopefully you have no trouble viewing my pseudocode.
Last edited by LuciWiz : 05-Nov-2005 at 16:04. Reason: Please insert your HTML code between [html] & [/html] tags
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:45.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.