Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

MYSQL

Name: Anonymous 2013-02-25 14:48

Ok so I'm completely new at working with MYSQL/php and I'm trying to create a mock website for a little side project. I'm finding the interaction between PHP and MYSQL pretty easy and I enjoy doing it. The only problem is that I don't think I am following all of the rules when making these databases.

The problem I just realized after creating my database is that I have no foreign keys. I will use this simplified example:

PATIENTS
PATIENT_ID PRIMARY KEY
NAME
ADDRESS
ETC...

To view their medical allergies though I need a separate table so I created:

MEDICAL_ALLERGIES
PATIENT_ID
ALLERGY

Is this bad practice? Essentially I am using the PATIENT_ID as a primary key and foreign key. If I follow this design for my system will it be broken? I just wanted to check before I get any farther.

Name: Anonymous 2013-02-25 16:36

MySQL still doesn't enforce foreign keys. Everything won't be fine.
Enjoy your jail term for HIPAA violations.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List