Bowla1111 Posted November 18, 2010 Posted November 18, 2010 Say iam making a vampire/werewolf game and when registering you have to choose vampire or werewolf. How would I go about making it were if you choose vampire your school, jobs are completely different then if you were to choose werewolf...do I have to make 2 databases? Quote
Blade Maker Posted November 18, 2010 Posted November 18, 2010 Not 2 databases but 2 different tables in 1 database would work, it would take a lot of time but its not impossible, its actually sorta simple, well not simple bot not very hard either. Quote
Uridium Posted November 19, 2010 Posted November 19, 2010 in your users table create a new field called character. This then gets complicated cos you will need people at signup to be classed as vampire or Werewolf when they join.. Then in your school table add visibleto as a varchar so it knows wether its a vampire or werewolf that will be taking the course.. Quote
joshuawdams Posted November 20, 2010 Posted November 20, 2010 I already made a modification that does the following and then some for 15.00 ;) Quote
Danny696 Posted November 20, 2010 Posted November 20, 2010 Wow oO you can sell this sh*t do what illusions said. No need for two databases, nor two tables. (unless you really want them) Just a simple column in the (overcrowded) users table sorts it :) Quote
Jordan Palmer Posted November 20, 2010 Posted November 20, 2010 Wow oO you can sell this sh*t do what illusions said. No need for two databases, nor two tables. (unless you really want them) Just a simple column in the (overcrowded) users table sorts it :) You can sell anything you like ;) Joshua's isn't bad for $15, Quote
indysolo621 Posted November 23, 2010 Posted November 23, 2010 couldnt you just add a character tabel to the user part of the DB and say if character is >1 do the vampire stuff and <1 do werewolf stuff. Would be quite simple but would just need to change stuff in code accordingly. That is if this would work Quote
Nickson Posted November 23, 2010 Posted November 23, 2010 The easiest way to have something like this is create a new integer field (tinyint(1)) in the main user table, with a good database design, this doesn't hurt at all. If you only have two options (vampire or werewolf, it sounds a lot like .. a true or false ;) a tiny int field can hold a 0 or 1 too. Thats the database part ... In you code you just use if($user['char']) { //do stuff if true } .. quite easy to do, you just need to remember what you named it. No need for extra databases, tables, or whatsoever, just 1 field which hardly takes up any space ;) and no conversion is needed from one type to another as php can handle 0/1s by default. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.