Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2007
    Posts
    126
    Plugin Contributions
    0

    Default Remove Unused Manufacturers

    I'm using this:

    SELECT * FROM manufacturers LEFT JOIN products ON manufacturers.manufacturers_id = products.manufacturers_id WHERE products.manufacturers_id IS NULL
    How can I delete the records returned?

  2. #2
    Join Date
    Dec 2007
    Posts
    21
    Plugin Contributions
    0

    Default Re: Remove Unused Manufacturers

    What about ONLY retrieving those you want?

    I'm using the manufacturerestabmod from here and have changed the query in manufacturers_tabs.php from
    Code:
    $manufacturers_tab_query = "select m.manufacturers_id, m.manufacturers_name from " .TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " md where m.manufacturers_id=md.manufacturers_id and md.languages_id=" . (int)$_SESSION['languages_id']. $order_by;
    to
    Code:
    $manufacturers_tab_query = 
    "select distinct m.manufacturers_id, m.manufacturers_name 
    from " .TABLE_MANUFACTURERS . " m, " .TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS_INFO . " md 
    where m.manufacturers_id=md.manufacturers_id 
    and p.manufacturers_id=m.manufacturers_id
    and md.languages_id=" . (int)$_SESSION['languages_id']. $order_by;
    I haven't thoroughly tested it yet but it seems to be working fine so far.

  3. #3
    Join Date
    Sep 2006
    Posts
    101
    Plugin Contributions
    0

    Default Re: Remove Unused Manufacturers

    You know there's an admin option to only display Manufacturers with (active) products right?
    Personalized candy favors and gifts: http://www.westcoastfavors.com

    The Sea Crew: http://www.theseacrew.com/shop/

  4. #4
    Join Date
    Nov 2007
    Posts
    126
    Plugin Contributions
    0

    Default Re: Remove Unused Manufacturers

    Yes but it is VERY slow with hundreds of manufacturers and several thousand products. I think we're in better shape now.

  5. #5
    Join Date
    Dec 2007
    Posts
    21
    Plugin Contributions
    0

    Default Re: Remove Unused Manufacturers

    Quote Originally Posted by solarflare View Post
    You know there's an admin option to only display Manufacturers with (active) products right?
    I thought I'd seen it somewhere but I cannot find it again.........

  6. #6
    Join Date
    Sep 2006
    Posts
    101
    Plugin Contributions
    0

    Default Re: Remove Unused Manufacturers

    Configuration->Maximum Values->Manufacturers List - Verify Product Exist
    Quote Originally Posted by Lou View Post
    I thought I'd seen it somewhere but I cannot find it again.........
    Personalized candy favors and gifts: http://www.westcoastfavors.com

    The Sea Crew: http://www.theseacrew.com/shop/

  7. #7
    Join Date
    Dec 2007
    Posts
    21
    Plugin Contributions
    0

    Default Re: Remove Unused Manufacturers

    Thanks, doesn't work for me because I'm using the manufacturerestabmod but it's good to know!

  8. #8
    Join Date
    Apr 2009
    Location
    Athens, Europe
    Posts
    125
    Plugin Contributions
    0

    Default Re: Remove Unused Manufacturers

    Hallo, happy new year!

    Quote Originally Posted by benn600 View Post
    I'm using this:



    How can I delete the records returned?
    Did you find an answer?

 

 

Similar Threads

  1. v139h Ok to remove/empty unused sql authorizenet?
    By divinelighting in forum General Questions
    Replies: 3
    Last Post: 18 Apr 2012, 12:31 AM
  2. Remove unused CSS tags?
    By Best Price Accessori in forum General Questions
    Replies: 4
    Last Post: 10 Dec 2009, 09:15 PM
  3. Delete unused manufacturers?
    By benn600 in forum General Questions
    Replies: 3
    Last Post: 19 Nov 2007, 11:44 PM

Posting Permissions

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