[PHP-DB] One field or a new table?

2008-06-20 Thread Hussein Jafferjee
Hey Guys, I have been developing for a while and never found the best solution yet. The question is lets say a game has 10 collectibles you can earn, to keep track of the number of collectibles each user has, do you have one field in the users table with all the numbers separated via a

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-20 Thread Evert Lammerts
I should've checked the assumption. A little strange though for a scripting language. I'd say, since default behaviour of mysql_* functions is to assume the last opened link when a parameter is not passed, and since default behaviour is to evaluate null, false and 0 the same, mysql_* functions

Re: [PHP-DB] One field or a new table?

2008-06-20 Thread Evert Lammerts
Whenever you can say: X has zero or more Y and Y has zero or more X you're talking about a Many to Many relationship between X and Y, and you need a link table with foreign key constraints. Example: Table X: id name 1 A 2 B 3 C Table Y: id name 1 K 2 L 3 M Linktable: X_id Y_id 1

[PHP-DB] MySQL circular buffer

2008-06-20 Thread Andrew Martin
Hello, I'm looking at implementing a database-level stack for a (multi stack) mail merge queue (able to queue up to 1 million messages per stack). Current workflow: server 1 (containing main db) transmits data sets (used to populate mail merge template) to server 2 server 2 web-facing script