Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33
  1. #1
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

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

    I'm getting a similar error when I try to use the new search fields in Admin > Orders.

    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) where (o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total') and op.products_id ='146']
    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.
    But I can't find where to edit SEO URLs in admin! It sounds like a contribution, but I'm not using any contribution like that.

    Ideas?

    ---Diana

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

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

    Yours is not "p.products_id" ... yours is "o.orders_id" --- Does this help?

    http://www.zen-cart.com/forum/showthread.php?t=79408
    .

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

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

    thanks for reply, Dr. Byte!

    I looked at Shrimp-Gumbo's suggestion as you linked, and it looks to me like that code is already in 1.3.8a.

    The code that's failing for me in admin/orders.php looks like this, line 753:
    PHP Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id ot.orders_id" . "
                   
    where o.orders_status s.orders_status_id and s.language_id
    '" . (int)$_SESSION['languages_id'] . "' and s.orders_status_id '" .
    (int)$status . "' 
    and ot.class = 'ot_total'  " . 
    I'm not sure how to edit this, could you suggest please?

    I'm using MySQL 5.0.27-standard, PHP 4.4.7. Our server was migrated to new hardware and upgrade MySQL, which has caused some minor issues in other PHP/MySQL apps like WordPress special character encoding.

    I have an option to upgrade to PHP 5, should I do that? :tremble: "tremble" because I'm running a few other apps... but they are all maintained to current versions: SMF forums, Moodle, WordPress.

    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) where (o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total') and (op.products_model like '%ONLINE%' or op.products_name like 'ONLINE%')]
    thanks!!! you're a dear.

    ---Diana

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

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

    Quote Originally Posted by dbrewster View Post
    Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) " . "
                   where o.orders_status = s.orders_status_id and s.language_id
    = '" . (int)$_SESSION['languages_id'] . "' and s.orders_status_id = '" .
    (int)$status . "' and ot.class = 'ot_total'  " .
    try this:
    Code:
    left join " . TABLE_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
    = '" . (int)$_SESSION['languages_id'] . "' and s.orders_status_id = '" .
    (int)$status . "'" .
    .

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

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

    Thanks!!!

    I tried out the code in my sandbox, and am still getting the same 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) where (o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total') and (op.products_model like '%ONLINE%' or op.products_name like 'ONLINE%')]
    The other search fields work fine, it's the new "Search by Product Name or ID:XX or Model" field that's misbehaving.

    thoughts?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

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

    Please look again at what I posted. You moved it to the wrong place, or didn't do it in the right query.
    There are several similar queries in that section of code.
    .

    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.

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

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

    OK, I found two similar queries.

    This one part I can't edit correctly, I'm getting a SQL error when I try to load orders.php with this code.

    Original code: line 746
    PHP Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id ot.orders_id" . "
    where (o.orders_status s.orders_status_id and s.language_id '" . (int)$_SESSION['languages_id'] . "' and ot.class = 'ot_total')  " . 
    My edit:
    PHP Code:
    left join " . TABLE_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 '" . (int)$_SESSION['languages_id'] . " ' " . 

  8. #8
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

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

    Did you accidentally remove a closing parenthesis from the spot where you moved the code "from"?

    What is the new SQL error?
    .

    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.

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

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

    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
    in:
    [select count(*) as total from (zen_orders o, zen_orders_status s ) 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']
    here are the three edits I'm trying with original line numbers referenced:

    admin/orders.php
    line 722
    PHP Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id ot.orders_id" . "
    where o.customers_id '" . (int)$cID . "' and o.orders_status s.orders_status_id and s.language_id '" . (int)$_SESSION['languages_id'] . "' and ot.class = 'ot_total' order by orders_id DESC"; 

    changed to:

    PHP Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id ot.orders_id and ot.class = 'ot_total'  " . "
    where o.customers_id '" . (int)$cID . "' and o.orders_status s.orders_status_id and s.language_id '" . (int)$_SESSION['languages_id'] . "' order by orders_id DESC"; 

    line 734
    PHP Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id ot.orders_id" . "
    where o.orders_status s.orders_status_id and s.language_id '" . (int)$_SESSION['languages_id'] . "' and s.orders_status_id '" . (int)$status . "' and ot.class = 'ot_total'  " . 
    changed to:
    PHP Code:
    left join " . TABLE_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
     
    '" . (int)$_SESSION['languages_id'] . "' and s.orders_status_id '" . (int)$status . "'" . 

    line 746
    PHP Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id ot.orders_id" . "
    where (o.orders_status s.orders_status_id and s.language_id '" . (int)$_SESSION['languages_id'] . "' and ot.class = 'ot_total')  " . 
    changed to:
    PHP Code:
    left join " . TABLE_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 '" . (int)$_SESSION['languages_id'] . "'" . 

    those are the only changes I've tried, in various combinations. The last change generates the SQL error on page load, but with only the first two edits the error on search remains.

    thank you for your time and troubleshooting brains!

    ---db
    Last edited by dbrewster; 14 Jan 2008 at 10:41 PM.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

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

    Quote Originally Posted by dbrewster View Post

    line 746
    Code:
    left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) " . "
    where (o.orders_status = s.orders_status_id and s.language_id = '" . (int)$_SESSION['languages_id'] . "' and ot.class = 'ot_total')  " .
    I repeat: You dropped a parenthesis ... as shown.
    .

    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.

 

 
Page 1 of 4 123 ... 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