Forums / All Other Contributions/Addons / 1054 Unknown column 'p.product_price_w' in 'field list'

1054 Unknown column 'p.product_price_w' in 'field list'

Started by stevefriedman71 on 2 Mar 2011, 10:14 PM · Views: 4,073

Results 1 to 20 of 26
2 Mar 2011, 10:14 PM
#1
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

1054 Unknown column 'p.product_price_w' in 'field list'

i received this error:

1054 Unknown column 'p.product_price_w' in 'field list'
in:
[select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.product_price_w, p.products_virtual, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id, p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute, p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max, p.products_sort_order from products p, products_description pd where p.products_id = pd.products_id and p.products_id = '932']
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.

It only seems to affect the product preview in the admin section of the cart and - my guess - it is related to the wholesale mod.
I asked before but haven't got any reply

2 Mar 2011, 10:17 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

What ZenCart Version?

What are your server specs?
php version especially

Zen-Venom Get Bitten

2 Mar 2011, 10:18 PM
#3
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

Yes, it's part of an addon.
You've evidently got the PHP part of the addon on your site, but you don't have the SQL changes applied to your site.

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

2 Mar 2011, 10:23 PM
#4
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

kobra:

What ZenCart Version?

What are your server specs?
php version especially

PHP version 5.2.15
MySQL Disk Space 21.87 MB
MySQL version 5.0.91-community
Apache version 2.2.17
Perl version 5.8.8

I also ran the sql again but the statements where ignored for reason of "tables already exist"

2 Mar 2011, 10:24 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

Please refer to DrByte's post

Zen-Venom Get Bitten

2 Mar 2011, 10:25 PM
#6
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

i ran the sql again and it says statements ignored tables already exist
zencart version 1.3.9h

2 Mar 2011, 10:36 PM
#7
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

Are you sure it's talking about the correct tables?

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

2 Mar 2011, 10:58 PM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

i ran the sql again and it says statements ignored tables already exist
Most add on SQL is configured for a standard table -
One with NO prefix

Do your other ZenCart tables have a prefix?

Zen-Venom Get Bitten

2 Mar 2011, 11:04 PM
#9
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

judging from the error message content, I was guessing they don't :blush:

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

2 Mar 2011, 11:19 PM
#10
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

nope. no pre-fix

3 Mar 2011, 12:05 AM
#11
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

so, what do i do now?

3 Mar 2011, 3:06 AM
#12
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

What's the actual SQL you're trying to run?

.
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 Mar 2011, 2:28 PM
#13
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

since i figured this error has to do with my dual pricing mod i ran this sql:

ALTER TABLE customers ADD customers_whole VARCHAR( 4 ) DEFAULT '0' NOT NULL;
ALTER TABLE products ADD products_price_w VARCHAR( 150 ) DEFAULT '0' AFTER products_price;
ALTER TABLE products_attributes ADD options_values_price_w VARCHAR( 150 ) DEFAULT '0' AFTER options_values_price;
ALTER TABLE products_discount_quantity ADD discount_price_w VARCHAR( 150 ) DEFAULT '0' AFTER discount_price;
ALTER TABLE customers ADD customers_wholesale VARCHAR( 4 ) DEFAULT '0' NOT NULL AFTER customers_whole;

3 Mar 2011, 8:34 PM
#14
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

Alright. What's confusing to me is you're saying that running that is giving you messages like "table already exists". But none of those statements are trying to create new tables. They're just adding new fields/columns. The error message should be different if that's the SQL you're running.

.
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 Mar 2011, 8:40 PM
#15
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

ok. just to be sure. here is the EXACT result of running it again:

Failed: 5
ERROR: Cannot ADD column customers_whole because it already exists.
ERROR: Cannot ADD column products_price_w because it already exists.
ERROR: Cannot ADD column options_values_price_w because it already exists.
ERROR: Cannot ADD column discount_price_w because it already exists.
ERROR: Cannot ADD column customers_wholesale because it already exists.
Note: 5 statements ignored. See "upgrade_exceptions" table for additional details.

3 Mar 2011, 8:48 PM
#16
drbyte avatar

drbyte

Sensei

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

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

And you're still getting "1054 Unknown column 'p.product_price_w' in 'field list'" ???

.
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 Mar 2011, 8:50 PM
#17
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

yes. still the same. i made a search in the code for that p. ...thingy and found quite a few instances. i thought i posted it but it seems the post is gone. and - oddly, the error is ONLY in the product preview in the admin section

3 Mar 2011, 8:57 PM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

Your SQL added the field:
products_price_w

The error is referencing:
p.product_price_w

Notice one has an S in the field name and one does not ... :eek:

You need to determine if the SQL is incorrect or the code calling it ...

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!]
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!

3 Mar 2011, 9:58 PM
#19
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

Ajeh:

Your SQL added the field:
products_price_w

The error is referencing:
p.product_price_w

Notice one has an S in the field name and one does not ... :eek:

You need to determine if the SQL is incorrect or the code calling it ...
Let me do some more research and i'lll be back wit the results...

3 Mar 2011, 10:23 PM
#20
stevefriedman71 avatar

stevefriedman71

Zen Follower

Join Date:
Sep 2006
Posts:
269
Plugin Contributions:
0

Re: 1054 Unknown column 'p.product_price_w' in 'field list'

I searched for the "p.product_price_w" in the shop coding and found it in 5 php files and also found references to other tables or columns (i don't know which) that have this p. in front:

$products_query = "select p.products_id, p.master_categories_id, p.products_status, pd.products_name, p.products_model, p.products_image,
p.products_price, p.products_price_w, p.products_weight, p.products_tax_class_id,
p.products_quantity_order_min, p.products_quantity_order_units,
p.product_is_free, p.products_priced_by_attribute,
p.products_discount_type, p.products_discount_type_from
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_id = '" . (int)$products_id . "'
and pd.products_id = p.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
this example is from includes/classes/shopping_cart.php