Thread: UK Counties sql

Results 1 to 10 of 14

Hybrid View

  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,446
    Plugin Contributions
    81

    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,446
    Plugin Contributions
    81

    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?

 

 

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

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