Results 1 to 3 of 3

Thread: Insert and delete - is this possible?

  1. #1
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Insert and delete - is this possible?

    Hi,
    I have created a site using Adobe Dreamweaver Developer Toolbox using PHP and MySQL.

    I have one table in which the user can tick a field to indicate that they have no family members at their address.

    If the person decides at a later stage that family members do reside at their address, I want the user to be able to add family members in a related table.

    Is it possible to delete the record in the first table, if one or more family members are added in the related table, and for this to be done automatically when the first family member record is added? If it is possible, I'd be extremely grateful if you could point me in the right direction.

    Many thanks,
    Gary

  2. #2
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    im not sure how your storing the data but you could update the first table to mark they have family members at the address.

    Code:
    1st table
    name,familymembersataddress,sysid
    bob            1                        E101
    
    2nd table
    ataddress,name,sysid
      E101      james    F212
    then you can check if familymembersataddress is 1 or 0 before looking for them in the 2nd table

  3. #3
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the reply - its appreciated. I'll give your suggestion a try.

    Gary

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •