ok, well i havnt used MySQL in a while, or PHP for that... but i'm trying to make a website and basicly it will have many tables that interact going on the user_id... so i'm wondering how to do this? do i need to set user_id as a primary key? will setting it this make it so the username has to be unique? because for this table i want the user to be able to have more than one submissions... i never used key's before and not even sure if i supost to in this case heh... so like the user would be logged in and would want to view all these submissions that are in multiple other tables using these username as a key? am i right?
CREATE TABLE monsters (
user_id varchar(25) NOT NULL, // person who submitted
submit_date bigint(18) NOT NULL,
monster_name varchar(80) NOT NULL,
climate_terrain varchar(150) NOT NULL,
frequency varchar(80) NOT NULL,
organization varchar(80) NOT NULL,
activity_cycle varchar(80) NOT NULL,
diet varchar(150) NOT NULL,
intelligence tinyint(25) NOT NULL, // select 1 to 20
treasure varchar(255) NOT NULL,
alignment varchar(20) NOT NULL, // select Neutral Good,Lawful Good,Chaotic Good,True Neutral,Neutral Evil,Lawful Evil,Chaotic Evil,Lawful Neutral,Chaotic Neutral
no_appearing int(9) NOT NULL, // allowed from 1 to 999,999,999
ac tinyint(2) NOT NULL, // select from -20 to 20
movement varchar(80) NOT NULL,
hit_dice varchar(80) NOT NULL,
thac0 tinyint(2) NOT NULL, // select from -20 to 20
no_attacks varchar(100) NOT NULL,
damage_attack varchar(100) NOT NULL,
special_attacks varchar(255) NOT NULL,
special_defenses varchar(255) NOT NULL,
magic_resistance tinyint(3) NOT NULL, // select from 0 to 100(%)
size varchar(100) NOT NULL,
morale varchar(80) NOT NULL,
xp_value bigint(18) NOT NULL,
appearance text(65535) NOT NULL,
combat text(65535) NOT NULL,
habitat_Society text(65535) NOT NULL,
ecology text(65535) NOT NULL,
PRIMARY KEY (user_id), // used to connect all databases to the one user
);
thanks for any help anyone can give me =)