Now I have another concept on which I need some light. Maybe my database is not designed properly or I am missing something. Any help or suggestions would be appreciated...
I am creating a site for my community and this is the logic. Each Family gets a Login and Password. The tblPrimary handles that. Each family has a unique Address, tblMember takes care of that.
Now each family has a few family members in their. Lets say a wife and 2 kids. I can enter the wifey information, but when I try to enter the info for kids, the database says, duplicate entry for somename@email.com
I am using the email field to create a join between the different tables. Everything upto this point is working perfect, its just that when I try to enter additional family member values, I get the error message. I believe its the database, but then again, I am not sure, so plz provide me with some insight. Thank You.
Code: Select all
CREATE TABLE tblprimary (
emailaddress varchar(100) NOT NULL default '',
password varchar(16) NOT NULL default '',
accesslevel tinyint(4) NOT NULL default '4',
UNIQUE KEY emailaddress (emailaddress)
) TYPE=MyISAM;
CREATE TABLE tblmember (
emailaddress varchar(100) NOT NULL default '',
firstname varchar(35) default NULL,
lastname varchar(35) default NULL,
middlename varchar(35) default NULL,
address varchar(100) default NULL,
city varchar(35) default NULL,
state char(2) default NULL,
zip varchar(6) default NULL,
country varchar(7) default NULL,
UNIQUE KEY (emailaddress),
) TYPE=MyISAM;
CREATE TABLE tblfamily (
emailaddress varchar(100) NOT NULL default '',
familyfirstN varchar(35) default NULL,
maritalS varchar(10) default NULL,
relationship varchar(35) default NULL,
occupation varchar(34) default NULL,
UNIQUE KEY emailaddress (emailaddress)
) TYPE=MyISAM;