Jump to content
MakeWebGames

Recommended Posts

Posted

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?

Posted

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..

Posted

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 :)

Posted
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,

Posted

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

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...