Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33
  1. #11
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    cool, thanks, the case of the missing parentheses! I got it, the page load is fixed.

    But it's still generating an error on "Search by Product Name or ID:XX or Model." All the other search fields work.

    I enter the word "ONLINE" in that field, it generates this error:

    1054 Unknown column 'o.orders_id' in 'on clause'
    in:
    [select count(distinct o.orders_id) as total from (zen_orders o, zen_orders_status s left join zen_orders_products op on (op.orders_id = o.orders_id) ) left join zen_orders_total ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total' ) where (o.orders_status = s.orders_status_id and s.language_id = '1') and (op.products_model like '%ONLINE%' or op.products_name like 'ONLINE%')]

  2. #12
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    Code:
    left join zen_orders_total ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total' )
    Change the o.orders_id (in the specific spot shown) to be op.orders_id instead.
    .

    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. #13
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    changed in all three places, as advised.
    PHP Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id 
    ot.orders_id and ot.class = 'ot_total'  " . " 
    became

    PHP Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (op.orders_id =
     
    ot.orders_id and ot.class = 'ot_total'  " . " 
    Error on page load:
    1054 Unknown column 'op.orders_id' in 'on clause'
    in:
    [select count(*) as total from (zen_orders o, zen_orders_status s ) left join zen_orders_total ot on (op.orders_id = ot.orders_id and ot.class = 'ot_total' ) where (o.orders_status = s.orders_status_id and s.language_id = '1')]
    You create the search_orders_products filter this way:
    PHP Code:
        $new_table " left join " TABLE_ORDERS_PRODUCTS " op on (op.orders_id = o.orders_id) ";
        
    $keywords zen_db_input(zen_db_prepare_input($_GET['search_orders_products']));
        
    $search " and (op.products_model like '%" $keywords "%' or op.products_name like '" $keywords "%')";
        if (
    substr(strtoupper($_GET['search_orders_products']), 03) == 'ID:') {
          
    $keywords TRIM(substr($_GET['search_orders_products'], 3));
          
    $search " and op.products_id ='" . (int)$keywords "'"
    we haven't looked at that code ... ? Disclaimer: I am pretty ignorant about how these queries are structured, and have no idea what's wrong. I just know that code is executing, too.

    well, I'm going home, to be continued tomorrow for me! Have a good evening, Dr. Byte!

    --diana

  4. #14
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    Quote Originally Posted by dbrewster View Post
    changed in all three places, as advised.
    No, not all 3 places ... just the one.
    .

    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.

  5. #15
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    964
    Plugin Contributions
    0

    bug Re: 1054 Unknown column 'p.products_id' in 'on clause'

    Quote Originally Posted by knitwerk View Post
    The site is 1.3.7 already.

    Update: the fix was in SEO URLs to set "Add category parent to beginning of URLs" to "false"

    Hope that can help anyone else in the same fix!

    Thanks for your help on PM, Merlin.
    Okkkk.. I never installed SEo stuff (using pre build temp[late which may already have) but still getting the same error.

    So where do I find the problem , in admin where ? can you please advise?

    Thanks
    Downunder QLD

  6. #16
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    PHP Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id ot.orders_id
     
    and ot.class = 'ot_total'  " . " 
    This line occurs 3 times in the search filter part of the code. I've tried changing each one singly to
    PHP Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (op.orders_id ot.orders_id
     
    and ot.class = 'ot_total'  " . " 
    If I change only the last instance, I get this error message:
    1054 Unknown column 'o.orders_id' in 'on clause'
    in:
    [select count(distinct o.orders_id) as total from (zen_orders o, zen_orders_status s left join zen_orders_products op on (op.orders_id = o.orders_id) ) left join zen_orders_total ot on (op.orders_id = ot.orders_id and ot.class = 'ot_total' ) where (o.orders_status = s.orders_status_id and s.language_id = '1') and (op.products_model like '%ONLINE%' or op.products_name like 'ONLINE%')]
    changing either of the first two instances produces this error message:
    1054 Unknown column 'o.orders_id' in 'on clause'
    in:
    [select count(distinct o.orders_id) as total from (zen_orders o, zen_orders_status s left join zen_orders_products op on (op.orders_id = o.orders_id) ) left join zen_orders_total ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total' ) where (o.orders_status = s.orders_status_id and s.language_id = '1') and (op.products_model like '%ONLINE%' or op.products_name like 'ONLINE%')]

  7. #17
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    your original edit suggestion doesn't actually occur in the code, so I approximated.

    left join zen_orders_total ot on (o.orders_id = ot.orders_id and ot.class = 'ot_total' )

  8. #18
    Join Date
    Oct 2005
    Location
    Germany
    Posts
    60
    Plugin Contributions
    0

    Default Re: 1054 Unknown column 'o.orders_id' in 'on clause'

    Is the problem solved now? I use all corrections I read above and I still have the same problem.
    The search:"Search by Product Name or ID:XX or Model " doesn't work.
    But isn't the problem in Line 689-697:
    PHP Code:
    if (isset($_GET['search_orders_products']) && zen_not_null($_GET['search_orders_products'])) {
        
    $new_fields '';
        
    $search_distinct ' distinct ';
        
    $new_table " left join " TABLE_ORDERS_PRODUCTS " op on (op.orders_id = o.orders_id) ";
        
    $keywords zen_db_input(zen_db_prepare_input($_GET['search_orders_products']));
        
    $search " and (op.products_model like '%" $keywords "%' or op.products_name like '" $keywords "%')";
        if (
    substr(strtoupper($_GET['search_orders_products']), 03) == 'ID:') {
          
    $keywords TRIM(substr($_GET['search_orders_products'], 3));
          
    $search " and op.products_id ='" . (int)$keywords "'"
    I try to test all corrections in the thread, but it doesn't work.

  9. #19
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: 1054 Unknown column 'o.orders_id' in 'on clause'

    I don't have this problem solved, either.

    For me, since it's an additional feature that I have lived without until now, it's a minor bug. Hopefully it will be working in the next release.

    ---Diana

  10. #20
    Join Date
    Oct 2005
    Location
    Germany
    Posts
    60
    Plugin Contributions
    0

    Default Re: 1054 Unknown column 'o.orders_id' in 'on clause'

    You're right, it is a usefull but unneeded feature. I don't want to have a mistake in my shop and so I will delete this searchbox in my orders.php.
    Thanks for your quick reply.
    Michael

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Replies: 4
    Last Post: 15 Nov 2010, 06:33 PM
  2. Replies: 14
    Last Post: 12 May 2010, 04:30 AM
  3. 1054 Unknown column 'o.orders_id' in 'on clause'
    By mumzie in forum General Questions
    Replies: 2
    Last Post: 2 Jan 2009, 09:07 AM
  4. 1054 Unknown column 'p.products_id' in 'on clause'
    By pepsishot in forum General Questions
    Replies: 14
    Last Post: 27 Aug 2007, 03:52 PM
  5. 1054 Unknown column 'p.products_id' in 'on clause'
    By yoster in forum Installing on a Windows Server
    Replies: 7
    Last Post: 2 Jun 2007, 04:41 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR