Thread: UK Counties sql

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default UK Counties sql

    I have tried to load this to my cart, however it is not working for all counties during installation it say;

    ERROR: Cannot execute because table zen_zones does not exist. CHECK PREFIXES!

    Any ideas?

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

    Default Re: UK Counties sql

    What is the DB_PREFIX in your configure.php files?

    Be sure to replace the "zen_" in "zen_zones" with whatever *Your* DB_PREFIX is defined to.
    .

    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
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: UK Counties sql

    Quote Originally Posted by DrByte View Post
    What is the DB_PREFIX in your configure.php files?

    Be sure to replace the "zen_" in "zen_zones" with whatever *Your* DB_PREFIX is defined to.
    Is this DB-prefix of the database?

  4. #4
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: UK Counties sql

    Looking at config.php there is

    // define our database connection
    define('DB_TYPE', 'mysql');
    define('DB_PREFIX', 'zen_');
    define('DB_CHARSET', 'utf8');
    define('DB_SERVER', 'localhost');
    define('DB_SERVER_USERNAME', 'brideand_zencecs');
    define('DB_SERVER_PASSWORD', '*********');
    define('DB_DATABASE', 'brideand_zencecs');

    So what should ; INSERT INTO `zen_zones` VALUES (182, 222, 'Bedfordshire', 'Bedfordshire'); say?

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

    Default Re: UK Counties sql

    Since the ZC tablename is "zones" and the DB_PREFIX is set to "zen_", then the sql query would read INSERT INTO zen_zones ...



    So, back to your very first post, it would seem that you had the wrong database selected in order to get an error about that table not existing.
    .

    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.

  6. #6
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: UK Counties sql

    I have taken advice from my service provider a copy of their reply is

    I have checked the table, zen_zones of the database brideand_zencecs. From your update, I understood that you are trying to insert an additional row into the table zen_zones.

    The error you got since the zone_id 182 already exists in the table:

    --
    mysql> select * from zen_zones where zone_id=182;
    +---------+-----------------+-----------+------------------------------+
    | zone_id | zone_country_id | zone_code | zone_name |
    +---------+-----------------+-----------+------------------------------+
    | 182 | 13 | ACT | Australian Capital Territory |
    +---------+-----------------+-----------+------------------------------+
    --

    To insert one row into the table you have to use the following query:

    INSERT INTO zen_zones VALUES ('zone_id', 'zone_country_id', 'zone_code', 'zone_name');

    The last entry's zone id in the table is 519. If you wanted to add new entry, then the zone id value should be 520. Then the query should be:

    INSERT INTO `zen_zones` VALUES (520, 222, 'Bedfordshire', 'Bedfordshire');

    I have made no changes my database to zen_zones so do you know why there is a conflict with Australian Capital? Could it be a conflict with another plugin that I have used?

  7. #7
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: UK Counties sql

    Quote Originally Posted by adb34 View Post
    I have taken advice from my service provider a copy of their reply is

    I have checked the table, zen_zones of the database brideand_zencecs. From your update, I understood that you are trying to insert an additional row into the table zen_zones.

    The error you got since the zone_id 182 already exists in the table:

    --
    mysql> select * from zen_zones where zone_id=182;
    +---------+-----------------+-----------+------------------------------+
    | zone_id | zone_country_id | zone_code | zone_name |
    +---------+-----------------+-----------+------------------------------+
    | 182 | 13 | ACT | Australian Capital Territory |
    +---------+-----------------+-----------+------------------------------+
    --

    To insert one row into the table you have to use the following query:

    INSERT INTO zen_zones VALUES ('zone_id', 'zone_country_id', 'zone_code', 'zone_name');

    The last entry's zone id in the table is 519. If you wanted to add new entry, then the zone id value should be 520. Then the query should be:

    INSERT INTO `zen_zones` VALUES (520, 222, 'Bedfordshire', 'Bedfordshire');

    I have made no changes my database to zen_zones so do you know why there is a conflict with Australian Capital? Could it be a conflict with another plugin that I have used?
    Using this still came back with an error as

    Error Failed: 1
    Error ERROR: Cannot execute because table zen_zones does not exist. CHECK PREFIXES!
    Warning Note: 1 statements ignored. See "upgrade_exceptions" table for additional details.

  8. #8
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: UK Counties sql

    I am still having problems with this. Since the last post I have changed ISPs and done a completely fresh install. I have several shops that I am trying to put this in to and no of them will accept it. Still giving me the error that I have written above. Is there any other questions on this plugin?

  9. #9
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: UK Counties sql

    I have found answer to this, with the help from another forum question. Remove the word 'zen_' from 'zen_zones' to leave 'zones' and it works with no problems. I need to check the counties list as some are out-of-date and then I will upload that data base list.

  10. #10
    Join Date
    Mar 2008
    Location
    Brampton, Cumbria, United Kingdom, United Kingdom
    Posts
    816
    Plugin Contributions
    2

    Default Re: UK Counties sql

    I have somehow loaded counties twice and have ended up with two of every county. Is there an easy way to edit the database or not?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Nevada/Tax/Counties?
    By Sellerz in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 5
    Last Post: 7 Nov 2012, 07:42 PM
  2. Uk Counties sql script for RoyalMail
    By discoverytdi in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 May 2012, 01:12 PM
  3. UK counties and US States
    By blackwolf in forum General Questions
    Replies: 6
    Last Post: 14 Apr 2010, 11:21 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