Ok Folks, some more problems from me...

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
pistolfire99
Forum Commoner
Posts: 58
Joined: Thu May 23, 2002 3:18 pm

Ok Folks, some more problems from me...

Post 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
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

Let's see the insert statement.

John M
pistolfire99
Forum Commoner
Posts: 58
Joined: Thu May 23, 2002 3:18 pm

Post 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
User avatar
nathus
Forum Commoner
Posts: 49
Joined: Thu Dec 12, 2002 6:23 pm

Post by nathus »

are the email addresses that are giving you problems already in the table?
Post Reply