Page 1 of 1

Ok Folks, some more problems from me...

Posted: Fri Dec 20, 2002 6:06 pm
by pistolfire99
As mentioned in an earlier post, some days back, I figured out the MySQL Join thingy after going through the tutorials on sqlcourse.com and my database works under certain circumstances.
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... :) Now here is my database.
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;
Pistolfire99

Posted: Sat Dec 21, 2002 9:37 am
by Johnm
Let's see the insert statement.

John M

Posted: Sat Dec 21, 2002 3:32 pm
by pistolfire99
Hello John,
I am using phpmyAdmin to enter values in the database. Well, this is going to change in the future when things get sorted out.

Pistolfire99

Posted: Sat Dec 21, 2002 3:42 pm
by nathus
are the email addresses that are giving you problems already in the table?