Forums / General Questions / UK Counties sql

UK Counties sql

Views: 2,202

Results 1 to 14 of 14
11 Sep 2013, 10:20 PM
#1
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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?

Learning Fast.
Eden Craft Supplies

12 Sep 2013, 2:55 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

12 Sep 2013, 12:10 PM
#3
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: UK Counties sql

DrByte:

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?

Learning Fast.
Eden Craft Supplies

12 Sep 2013, 8:42 PM
#4
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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?

Learning Fast.
Eden Craft Supplies

12 Sep 2013, 8:53 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

19 Sep 2013, 10:47 AM
#6
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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?

Learning Fast.
Eden Craft Supplies

19 Sep 2013, 3:09 PM
#7
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: UK Counties sql

adb34:

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.

Learning Fast.
Eden Craft Supplies

7 Apr 2014, 12:06 PM
#8
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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?

Learning Fast.
Eden Craft Supplies

7 Apr 2014, 1:03 PM
#9
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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.

Learning Fast.
Eden Craft Supplies

20 Apr 2014, 1:00 PM
#10
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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?

Learning Fast.
Eden Craft Supplies

22 Apr 2014, 2:19 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: UK Counties sql

Yes. Look at the .sql you loaded. And for every line in that .sql file, note the table it's inserting into. Find that table, and remove the specified record. Be sure to delete the newest record ONLY. Because if you delete the older (smaller id number) record then you'll break customer/order records that link to that older record, causing you messes all over the place.
This is the sort of thing a skilled db administrator should do.

ALWAYS MAKE COMPLETE TESTED BACKUPS BEFORE DOING ANY DIRECT DATABASE MANIPULATION!!!!!!!!!

... You DO make backups, right?

.
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.

22 Apr 2014, 4:49 PM
#12
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: UK Counties sql

DrByte:

ALWAYS MAKE COMPLETE TESTED BACKUPS BEFORE DOING ANY DIRECT DATABASE MANIPULATION!!!!!!!!!

... You DO make backups, right?

OHHHHHHH yyyyyyeeeeeessssss

Learning Fast.
Eden Craft Supplies

5 Dec 2014, 3:04 PM
#13
kezerb avatar

kezerb

New Zenner

Join Date:
Sep 2008
Posts:
46
Plugin Contributions:
0

Re: UK Counties sql

When installing this on 1.5.3 I get
"WARNING: An Error occurred, please refresh the page and try again."
And when I go back to the main admin, my zone's no longer work at all.

How can I uninstall the sql :\

14 Dec 2014, 2:16 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: UK Counties sql

kezerb:

When installing this on 1.5.3 I get
"WARNING: An Error occurred, please refresh the page and try again."
And when I go back to the main admin, my zone's no longer work at all.

How can I uninstall the sql :
The way to "uninstall" something like that is to use the backup you made of your database before running the script in the first place.

.
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.