In message <[EMAIL PROTECTED]>, Pete <[EMAIL PROTECTED]> writes >>Here's an example: >>If your patient row is: ID: 240 | Firstname: John | Lastname: Smith >>and your med row is: ID: 12 | medname: aspirin >>then your lookup row would like like this: >> ID: 320 | patient_id: 240 | med_id: 12 |comment: Smith Aspirin
Slip of my brain here... >If you are the DBA, it should be almost second nature to type in the >SELECT patName FROM patients WHERE patID=320; Should be SELECT patName FROM patients WHERE patID=240; The ID in the lookup table serves no purpose, I missed the fact that it was there. To show all the medications for patient 240 SELECT medDesc FROM meds, lookup WHERE lkpMed=medID AND lkpPat=240; Using indexes on patId, medID, lkpMed. -- Pete Clark http://www.hotcosta.com http://www.spanishholidaybookings.com ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/A77XvD/vlQLAA/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/
