SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    Montreal
    Posts
    275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Removing some data from a database

    Hi,

    here's the situation. Let's say I have a product database where one product have multiple entry in those tables:

    - product
    - product_color
    - product_size
    - product_inventory
    - product_order

    Is there a quick way to remove from all those tables any row related to a specific product without having to execute 5 queries in this case?

    Thank

  2. #2
    SitePoint Guru
    Join Date
    Jan 2004
    Location
    Uppsala, sverige
    Posts
    698
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Define foreign key constraints with on delete cascade. Note that not all database engines for Mysql support foreign keys.


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
  •