Hello,
I wonder if you could advise on this point.

The question is about the best way to design  a
"many-to-many"  relationship in terms of speed of
execution and efficiency

To explain it - There are these two lists :
Medicines = 70 
Patients     = 2000 

Now, I want to design the database so that a user
could SELECT a "Patient's Name" to find out which
MEDICINES he/she has been 

prescribed.

There are already 70 tables, (one for each medicine). 
Each table has a column listing all the patients on
that medicine. For example:

        ASPIRIN   lists 1989 patients's names (in one column)
        VALIUM    lists   734 patients' names
         so on

There is also one table called PATIENTS. It lists all
the 2000 individuals' names

Is there a better way other than the obvious one - to
me as a novice - i.e  to have 71 columns like so

 PATIENT_NAME     |   Aspirin  |    Valium   |  
Panadol  |    Penicillin    |    Vitamin_C    |  ...
to  MEDICINE70

The PATIENT_NAME column will have ALL  2000 patients.
The rows may have  some of the 70 MEDICINEs 
(obviously depending on whether he/she is on that
drug)

Then one could use "mysql_fetch_array" to get the
result as an array.

Perhaps there is a faster and more efficient way!  
 

Regards
David


                
___________________________________________________________ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/CefplB/TM
--------------------------------------------------------------------~-> 

The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to