Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Dec 2010
    Posts
    21
    Plugin Contributions
    0

    Default deleted zones from zen_zones

    Howdy all,

    I deleted all of the zones from zen_zones database and know I can only select one state when making an account.

    I need to add the other 49 states back in. What is the easiest way to to this? Im not that familiar with sql. Can I make a spreadsheet with the required info and upload it?

    Any help would be appreciated.

    Brent

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

    Default Re: deleted zones from zen_zones

    Best to restore from the backup you made before deleting them.
    .

    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
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,103
    Plugin Contributions
    11

    Default Re: deleted zones from zen_zones

    IF no backup, perhaps http://tinyurl.com/7mjaw5l can help.

  4. #4
    Join Date
    Dec 2010
    Posts
    21
    Plugin Contributions
    0

    Default Re: deleted zones from zen_zones

    Quote Originally Posted by DrByte View Post
    Best to restore from the backup you made before deleting them.
    I dont have a back up. I was working with a fresh installation. Thanks though.

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: deleted zones from zen_zones

    Look at your database in phpMyAdmin ...

    How many records are in the zones table now?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Dec 2010
    Posts
    21
    Plugin Contributions
    0

    Default Re: deleted zones from zen_zones

    Quote Originally Posted by Ajeh View Post
    Look at your database in phpMyAdmin ...

    How many records are in the zones table now?
    Only one for Nevada. I put this together and was planning on pasting it in SQL tools.

    Code:
    INSERT INTO 'zones' ('zone_id', 'zone_country_id', 'zone_code', 'zone_name') VALUES
    (1, 223, AL, Alabama),
    (2, 223, AK, Alaska),
    (3, 223, AZ, Arizona),
    (4, 223, AR, Arkansas),
    (5, 223, CA, California),
    (6, 223, CO, Colorado),
    (7, 223, CT, Connecticut),
    (8, 223, DE, Delaware),
    (9, 223, FL, Florida),
    (10, 223, GA, Georgia),
    (11, 223, HI, Hawaii),
    (12, 223, ID, Idaho),
    (13, 223, IL, Illinois),
    (14, 223, IN, Indiana),
    (15, 223, IA, Iowa),
    (16, 223, KS, Kansas),
    (17, 223, KY, Kentucky),
    (18, 223, LA, Louisiana),
    (19, 223, ME, Maine),
    (20, 223, MD, Maryland),
    (21, 223, MA, Massachusetts),
    (22, 223, MI, Michigan),
    (23, 223, MN, Minnesota),
    (24, 223, MS, Mississippi),
    (25, 223, MO, Missouri),
    (26, 223, MT, Montana),
    (27, 223, NE, Nebraska),
    (28, 223, NV, Nevada),
    (29, 223, NH, New Hampshire),
    (30, 223, NJ, New Jersey),
    (31, 223, NM, New Mexico),
    (32, 223, NY, New York),
    (33, 223, NC, North Carolina),
    (34, 223, ND, North Dakota),
    (35, 223, OH, Ohio),
    (36, 223, OK, Oklahoma),
    (37, 223, OR, Oregon),
    (38, 223, PA, Pennsylvania),
    (39, 223, RI, Rhode Island),
    (40, 223, SC, South Carolina),
    (41, 223, SD, South Dakota),
    (42, 223, TN, Tennessee),
    (43, 223, TX, Texas),
    (44, 223, UT, Utah),
    (45, 223, VT, Vermont),
    (46, 223, VA, Virginia),
    (47, 223, WA, Washington),
    (48, 223, WV, West Virginia),
    (49, 223, WI, Wisconsin),
    (50, 223, WY, Wyoming);

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

    Default Re: deleted zones from zen_zones

    The first line in the code above should read:
    Code:
    INSERT INTO `zones` (`zone_id`, `zone_country_id`, `zone_code`, `zone_name`) VALUES
    When i past the code it get this error:

    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IN, Indiana), (15, 223, IA, Iowa), (16, 223, KS, Kansas), (17, 223, KY, Kentucky' at line 1
    in:
    [INSERT INTO zen_zones (zone_id, zone_country_id, zone_code, zone_name) VALUES (1, 223, AL, Alabama), (2, 223, AK, Alaska), (3, 223, AZ, Arizona), (4, 223, AR, Arkansas), (5, 223, CA, California), (6, 223, CO, Colorado), (7, 223, CT, Connecticut), (8, 223, DE, Delaware), (9, 223, FL, Florida), (10, 223, GA, Georgia), (11, 223, HI, Hawaii), (12, 223, ID, Idaho), (13, 223, IL, Illinois), (14, 223, IN, Indiana), (15, 223, IA, Iowa), (16, 223, KS, Kansas), (17, 223, KY, Kentucky), (18, 223, LA, Louisiana), (19, 223, ME, Maine), (20, 223, MD, Maryland), (21, 223, MA, Massachusetts), (22, 223, MI, Michigan), (23, 223, MN, Minnesota), (24, 223, MS, Mississippi), (25, 223, MO, Missouri), (26, 223, MT, Montana), (27, 223, NE, Nebraska), (28, 223, NV, Nevada), (29, 223, NH, New Hampshire), (30, 223, NJ, New Jersey), (31, 223, NM, New Mexico), (32, 223, NY, New York), (33, 223, NC, North Carolina), (34, 223, ND, North Dakota), (35, 223, OH, Ohio), (36, 223, OK, Oklahoma), (37, 223, OR, Oregon), (38, 223, PA, Pennsylvania), (39, 223, RI, Rhode Island), (40, 223, SC, South Carolina), (41, 223, SD, South Dakota), (42, 223, TN, Tennessee), (43, 223, TX, Texas), (44, 223, UT, Utah), (45, 223, VT, Vermont), (46, 223, VA, Virginia), (47, 223, WA, Washington), (48, 223, WV, West Virginia), (49, 223, WI, Wisconsin), (50, 223, WY, Wyoming);]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
    There isn't any obvious errors in my code. Do you have any ideas?

    Also, I noticed that zone_id is set as auto increment. Should i remove that from my code?
    Last edited by mentose457; 21 Jan 2012 at 05:55 AM.

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: deleted zones from zen_zones

    Those do not match the defaults in a clean install ...

    You might look in the /zc_install/sql/mysql_latin1.sql or the /zc_install/sql/mysql_utf8.sql depending on how you set up your database and you will see the INSERT statements for USA ...

    I would back everything up and rebuild that table ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    Jan 2004
    Posts
    66,363
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: deleted zones from zen_zones

    Why exactly did you delete things in the first place?
    Quote Originally Posted by mentose457 View Post
    I dont have a back up. I was working with a fresh installation.
    If it was a fresh install, then another fresh install will put back everything as it was.
    .

    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.

  10. #10
    Join Date
    Dec 2010
    Posts
    21
    Plugin Contributions
    0

    Default Re: deleted zones from zen_zones

    Quote Originally Posted by DrByte View Post
    Why exactly did you delete things in the first place?
    If it was a fresh install, then another fresh install will put back everything as it was.
    I Thought I was deleting the ability to set up shipping/taxing zones. Not the ability to select the state while signing in.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. how to prevent image from being deleted when a product is deleted?
    By denniszc in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 7 Mar 2013, 03:01 PM
  2. Replies: 13
    Last Post: 12 Apr 2011, 11:11 PM
  3. Should I create new zones table as zen_zones
    By nnitin in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 28 Oct 2008, 07:33 AM
  4. Countries and zones deleted
    By jgarabot in forum General Questions
    Replies: 6
    Last Post: 31 Dec 2006, 04:16 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