If I understand you correctly, you probably want to look into "left
joins".  I.e.

        select a.field, b.field from table1 a left join table2 b on
a.id=b.tbl1.id

vs

        select a.field, b.field from table1a, table2 b where
a.id=b.tbl1.id

The first will show matching rows from table1 even when there have no
matching rows in table2, whereas the second will show matching rows from
table1 only when matches exist in table2 as well.

Good luck...

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
> m] On Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, June 14, 2001 12:32 PM
> To: [EMAIL PROTECTED]
> Subject: mysql-relationships
> 
> 
> Hey all,
> This is actually more of a theory question than anything 
> else. I have most of my databases built to 4th normal form. 
> So that means I am have tons of foreign keys to primary keys 
> and what-not. Almost every table is linked to another table. 
> The only problem I can forsee is when you decide to delete a 
> record that is being linked by another table. Many of my PHP 
> scripts blow up when they dont see what they are suppose to 
> see... So the linked ID (lets say 1) is still going to be in 
> the users table but when you query it wont find the table it 
> was being linked too!!! 
> How do you counter act this?
> My system can get very complex..do I need to write a script 
> to couteract every single possible error???
> 
> 
> Indy
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail 
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to