Submit Your Article Forum Rules

Results 1 to 3 of 3

Thread: OSComm - Search Error

  1. #1
    Senior Member
    Join Date
    Jul 2003
    Posts
    290

    OSComm - Search Error

    All, I am getting the following error when I submit a search from either the Advanced Search page or through the Search Box Anywhere Contribution:

    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_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%huggies%' or p.products_model like '%huggies%' or m.manufacturers_name like '%huggies%' or p2pef.products_extra_fields_value like '%huggies%') )

    When I do a search through the Search Box Anywhere Contribution AND also through the Advanced Search Page.

    I do not know enough about php or mysql to figure out why this is happening or where to start and fix it. I can assume it has something to do with the 'pd' mentioned in the first line?

    You can look here at my site to see it: SPOG - San Pedro Online Grocery


    Please help!
    Rob

  2. #2
    WebProWorld MVP wige's Avatar
    Join Date
    Jun 2006
    Posts
    2,981

    Re: OSComm - Search Error

    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_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%huggies%' or p.products_model like '%huggies%' or m.manufacturers_name like '%huggies%' or p2pef.products_extra_fields_value like '%huggies%') )

    I think you are joining products_description twice - if you do that, you need to give each one a different alias, so that MySQL knows which join to look at. Of course, that is after just a brief try at following the query...
    The best way to learn anything, is to question everything.
    Hidden Content

  3. #3
    Senior Member
    Join Date
    Jul 2003
    Posts
    290

    Re: OSComm - Search Error

    Oddly I uploaded the original advanced_search_results.php file and it works perfectly. And I cannot see any thing that functions or works differently or incorrectly.

    So I guess this is resolved... odd still, but resolved!!
    Rob

Similar Threads

  1. OSComm - Add to Cart Redirect
    By ackerley1 in forum eCommerce Discussion Forum
    Replies: 3
    Last Post: 07-27-2009, 06:29 PM
  2. OSComm - Export Orders
    By ackerley1 in forum eCommerce Discussion Forum
    Replies: 2
    Last Post: 07-27-2009, 09:42 AM
  3. Runtime Error - Line 1 - Error Syntex Error
    By charms987 in forum Graphics & Design Discussion Forum
    Replies: 6
    Last Post: 07-29-2005, 12:56 PM
  4. Error in robot metatag: consequence in Google search?
    By slainthe in forum Google Discussion Forum
    Replies: 5
    Last Post: 06-30-2004, 04:58 AM
  5. error on google.com search engine submition
    By sbirc in forum Search Engine Optimization Forum
    Replies: 2
    Last Post: 05-11-2004, 02:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •