Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2006
    Posts
    11
    Plugin Contributions
    0

    Default hypothetical delete customers question

    I've been developing a little mod to zencart and I've got about 50 or so test accounts that I've made and deleted at various times. I'm going live with the site and I don't need any of these accounts now. So would it be safe for me to do...

    Code:
    DELETE FROM customers WHERE id = all ids
     ALTER TABLE customers AUTO_INCREMENT = 0
    followed by a

    Code:
    DELETE FROM address_book WHERE id = all ids
    ALTER TABLE address_book AUTO_INCREMENT = 0
    Those are just generic queries, I know they aren't right. But mainly I'd like to know if I need to delete in any other locations?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: hypothetical delete customers question

    You need to also handle the related customers_info records and customer_basket records and customer_basket_attributes records.

    If you're trying to simply delete *all* customer records, it would be simpler to use "truncate" and the table name, since that also resets the auto-increment counter while deleting all contents.



    OR ... you could simply use the built-in function to delete customers, and have it loop thru them all and delete them one by one


    Reference docs:
    http://www.zen-cart.com/wiki/index.p...atabase_Schema
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2008
    Posts
    328
    Plugin Contributions
    0

    help question Re: hypothetical delete customers question

    Quote Originally Posted by DrByte View Post
    OR ... you could simply use the built-in function to delete customers, and have it loop thru them all and delete them one by one
    This is exactly what I am looking for. Where can I find more information about this built-in function?

    Name of .php file and/or function would be super. Thanks!

 

 

Similar Threads

  1. No delete customers option.
    By gloerick in forum General Questions
    Replies: 10
    Last Post: 22 Jan 2011, 02:16 AM
  2. Can i delete all my customers?
    By touchclothing in forum General Questions
    Replies: 9
    Last Post: 29 Oct 2009, 06:11 AM
  3. Delete all customers
    By panzico in forum General Questions
    Replies: 1
    Last Post: 14 May 2009, 06:29 PM
  4. All customers fields in ADMIN > CUSTOMERS are empty and I can't delete them!
    By plgaudreau in forum Managing Customers and Orders
    Replies: 1
    Last Post: 26 Feb 2008, 02:08 AM
  5. Delete Customers?
    By londonexpo in forum General Questions
    Replies: 0
    Last Post: 10 Dec 2006, 11:52 AM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR