Jump to content

Multiple or single table?


apw

Recommended Posts

My question is regarding info that should either be in a single table database or multiple tables.  The data that will be in this or these tables is data that my web-game uses to handle player information.  For example one table called pfile handles the basic login info and a few starting stats.  As the player plays he will gain new technologies, new buildings, units, etc.  My question is with so much info that will be processed and needed is it smart and wise to push this into one table or expand and have multiple tables for each technology, unit, resource, etc.  And how would i link this info together so nothing goes wrong?

Link to comment
https://forums.phpfreaks.com/topic/142640-multiple-or-single-table/
Share on other sites

On the new table have a field Called UserID (this will have the same value as the Prime field in the usres table) and IMO i would probably keep a table for logins and another for game status info

 

EDIT: oh and link them via a JOIN but if you have the UserID stored in session during login you can just pass that to the other table directly to get Game Info) but if you want to get the Users name etc your need to either use a JOIN or do 2 queries

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.