Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error 1066 - Not unique table/alias: 'pd'


tlalochj

Recommended Posts

I have this error message whet I try to search or make an advanced search , I install the Products Extra field Contribution, When I change the original files with the search and advanced search files of the products extra field contribution I have a error message Product not foun And If I put the original search and advanced search the error message tha appears it's

 

1066 - Not unique table/alias: 'pd'

select count(distinct p.products_id) as total from (products p left join products_to_products_extra_fields p2pef on p.products_id=p2pef.products_id) left join manufacturers m on m.manufacturers_id=p.manufacturers_id, products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c, products_extra_fields pef, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '3' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and pef.products_extra_fields_id=p2pef.products_extra_fields_id and ((pd.products_name like '%harry%' or p.products_model like '%harry%' or m.manufacturers_name like '%harry%' or pef.products_extra_fields_name like '%harry%' or p2pef.products_extra_fields_value like '%harry%') )

[TEP STOP]

 

 

Somebody can help me

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 2 months later...

I am having the same problem too. Although I dont have the products extra field.

 

Anyone have any idea on this? Or do any of you guys who have had the same problem found a fix?

 

Cheers

Fiona

Link to comment
Share on other sites

  • 1 month later...
I am having the same problem too. Although I dont have the products extra field.

 

Anyone have any idea on this? Or do any of you guys who have had the same problem found a fix?

 

Cheers

Fiona

 

this a MySQL 5 issue so I presume you are all using MySQL 5. If so I'll try and dig around to see if there is a solution..

Link to comment
Share on other sites

  • 3 months later...
I have this error message whet I try to search or make an advanced search , I install the Products Extra field Contribution, When I change the original files with the search and advanced search files of the products extra field contribution I have a error message Product not foun And If I put the original search and advanced search the error message tha appears it's

 

1066 - Not unique table/alias: 'pd'

select count(distinct p.products_id) as total from (products p left join products_to_products_extra_fields p2pef on p.products_id=p2pef.products_id) left join manufacturers m on m.manufacturers_id=p.manufacturers_id, products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c, products_extra_fields pef, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '3' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and pef.products_extra_fields_id=p2pef.products_extra_fields_id and ((pd.products_name like '%harry%' or p.products_model like '%harry%' or m.manufacturers_name like '%harry%' or pef.products_extra_fields_name like '%harry%' or p2pef.products_extra_fields_value like '%harry%') )

[TEP STOP]

Somebody can help me

 

You are trying to redeclare an alias; this is not allowed. You already stated TABLE_PRODUCTS_DESCRIPTION is pd and don't need to do it again. I see you will get the same error for 'c' and 'p2c' as well. Remove the duplicate alias and you should be fine.

 

 

products_description pd, categories c, products_to_categories p2c

Link to comment
Share on other sites

  • 7 months later...
You are trying to redeclare an alias; this is not allowed. You already stated TABLE_PRODUCTS_DESCRIPTION is pd and don't need to do it again. I see you will get the same error for 'c' and 'p2c' as well. Remove the duplicate alias and you should be fine.

 

 

products_description pd, categories c, products_to_categories p2c

 

What file do we make this edit in?

Link to comment
Share on other sites

  • 2 weeks later...
You are trying to redeclare an alias; this is not allowed. You already stated TABLE_PRODUCTS_DESCRIPTION is pd and don't need to do it again. I see you will get the same error for 'c' and 'p2c' as well. Remove the duplicate alias and you should be fine.

 

 

products_description pd, categories c, products_to_categories p2c

 

I'm having the exact same problem as well, and I also just installed the Product Extra Fields contribution. Any help on how exactly to go about removing the duplicate alias would be greatly appreciated!

 

(and yes, I am using MySQL 5)

Edited by CrazedRabbit
Link to comment
Share on other sites

I'm having the exact same problem as well, and I also just installed the Product Extra Fields contribution. Any help on how exactly to go about removing the duplicate alias would be greatly appreciated!

 

(and yes, I am using MySQL 5)

 

change

 $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

to

 

  $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " , " . TABLE_CATEGORIES . " , " . TABLE_PRODUCTS_TO_CATEGORIES . " ";

Edited by Job
Link to comment
Share on other sites

  • 3 weeks later...

Thank you for this help but I am still getting the same error.

 

I installed

 

http://addons.oscommerce.com/info/3521

 

Because I need separate names for the different languages of my manufacturers. I followed the Install Manual but now it get the following error after installing the above Add-On, when I click onto a category ie:

 

http://organicbeauty.ch/index.php/cPath/71

 

I get this error:

 

1054 - Unknown column 'm.manufacturers_name' in 'field list'

 

select p.products_quantity, p.products_weight, m.manufacturers_name, p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ((products_description pd, products p) left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c) left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '71' order by pd.products_name limit 0, 20

 

Any help is greatly appreciated.

 

Best

Zeno

Link to comment
Share on other sites

Ok got it to work on my local Machine!

 

See

http://www.oscommerce.com/forums/index.php?s=&...t&p=1321889

 

If you have "1054 - Unknown column 'p.products_id' in 'on clause'" problems do the "()" after 'from' and before 'left join' according to http://forums.oscommerce.nl/index.php?show...44444&st=0# and according to the AddOn http://www.oscommerce.com/community/contributions,4654

 

Best

Zeno

Link to comment
Share on other sites

I have installed the product extra field, and had the same problem, this fixed the situation:

 

$from_str = "from (" . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id) 
left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id=p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . "
s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

 

changed to:

 

  $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id 
left join ". TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";

 

hope this helps.

Edited by ureche
Link to comment
Share on other sites

  • 7 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...