Page 1 of 3 123 LastLast
Results 1 to 10 of 30

1054 - Unknown column 'a.authors_id' in 'on clause'

This is a discussion on 1054 - Unknown column 'a.authors_id' in 'on clause' within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Hi using latest release of oscmax. I cannot get the Articles function to work correctly. I keep getting the following ...

      
  1. #1
    Member
    Join Date
    Jun 2004
    Location
    UK
    Posts
    56
    Rep Power
    0


    Default 1054 - Unknown column 'a.authors_id' in 'on clause'

    Hi using latest release of oscmax. I cannot get the Articles function to work correctly.
    I keep getting the following error mesage...

    1054 - Unknown column 'a.authors_id' in 'on clause'

    select count(*) as total from articles a, articles_description ad left join authors au on a.authors_id = au.authors_id, articles_to_topics a2t left join topics_description td on a2t.topics_id = td.topics_id where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_status = '1' and au.authors_id = '1' and a.articles_id = a2t.articles_id and ad.articles_id = a2t.articles_id and ad.language_id = '1' and td.language_id = '1'

    [TEP STOP]

    Is there an obvious reason I should be looking for here as I cant see where I am going wrong?
    Have tried with both PHP4 and 5. No difference.
    Have created author, article, enabled articles in admin so link can be seen from front page but just keep getting error above.

    Please advise.

    Phil.

  2. #2
    Member
    Join Date
    Jun 2004
    Location
    UK
    Posts
    56
    Rep Power
    0


    Default RE: 1054 - Unknown column

    So 40 plus people have viewed this problem yet no one can answer the question!!!
    Presumably if people ae viewing it then they to are looking for a way to make it work.
    I have also noticed that many other people have posted similar questions on other forums and got nowhere.

    Does this feature work or not?

    Surely someone must have some ideas please.
    Phil

  3. #3
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    20,759
    Rep Power
    573


    Default RE: 1054 - Unknown column

    Nobody has responded because you did not provide enough info for anyone to help. We need to know how you generate the error, what page it happens on, what versions of mysql, what webserver (apache? IIS?)...
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  4. #4
    Lurker
    Join Date
    May 2007
    Posts
    1
    Rep Power
    0


    Post Re: 1054 - Unknown column 'a.authors_id' in 'on clause'

    Edit the files called articles.tpl.php and articles_new.tpl.php in your templatename/content folder.

    Look for the queries containing:
    from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td on

    and change them into:
    from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t) left join " . TABLE_TOPICS_DESCRIPTION . " td on

    (putting parenthesis after "from" and before "left join" statements).


    MySQL 5.0.15 follows the syntax rules of SQL:2003:

    <from clause> ::= FROM <table reference list>
    <table reference list> ::=
    <table reference> [ { <comma> <table reference> }… ]
    <table reference> ::=
    <table factor>
    | <joined table>
    <joined table> ::=
    <cross join>
    | <qualified join>
    | <natural join>



  5. #5
    Active Member MindTwist's Avatar
    Join Date
    Jun 2007
    Location
    Barcelona, Spain
    Posts
    409
    Rep Power
    8


    Default Re: 1054 - Unknown column 'a.authors_id' in 'on clause'

    Bleh... I am having that exact ame error too. Will look into it.

    Running:

    Linux 2.6.9-42.ELsmp
    MySQL 5.0.27-standard
    PHP 5.1.6 (Zend: 2.1.0)
    Apache/1.3.37 (Unix) PHP/5.1.6 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a

  6. #6
    Active Member MindTwist's Avatar
    Join Date
    Jun 2007
    Location
    Barcelona, Spain
    Posts
    409
    Rep Power
    8


    Default Re: 1054 - Unknown column 'a.authors_id' in 'on clause'

    Ok, I would say it is working perfect for me now, I changed several more lines besides the ones that Pape Design says, otherwise I could see all articles, but it was giving me errors when seeing a given category.

    The solution was over here:
    article manager 1.2b-1054-&#39;a.authors_id&#39; - osCommerce Community Support Forums

    -----
    I had this problem. I wrapped the FROM statements in () and it works fine now. Something to do with the way the new MySQL 5 functions are prioritized.

    before - ("select count(*) as total from " . TABLE_TOPICS . " where parent_id =
    after - ("select count(*) as total from (" . TABLE_TOPICS . ") where parent_id =
    -----

    So I did as stated, searched all "from"s on articles.tpl.php and put the () on them. There are I think 13 of them, I do not know if I needed the () on all of them, but everything seems to be working now.

  7. #7
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    20,759
    Rep Power
    573


    Default Re: 1054 - Unknown column 'a.authors_id' in 'on clause'

    Hey,

    I believe this is patched in SVN... You may want to grab the fileset. You could also try the articles update by JPF which is in a nice neat package for you (instead of fussing with SVN repository):

    219: Problems with Article not showing up when clicking on them - Bug Tracker - open source Commerce Maximized :: osCMax
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  8. #8
    Active Member MindTwist's Avatar
    Join Date
    Jun 2007
    Location
    Barcelona, Spain
    Posts
    409
    Rep Power
    8


    Default Re: 1054 - Unknown column 'a.authors_id' in 'on clause'

    Hope I haven't messed up and it can help!

    Articles.tpl.php from /fallback (lines should match for an unmodified template)

    Line 6:
    Code:
        $topic_query = tep_db_query("select td.topics_name, td.topics_heading_title, td.topics_description from (" . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td ) where t.topics_id = '" . (int)$current_topic_id . "' and td.topics_id = '" . (int)$current_topic_id . "' and td.language_id = '" . (int)$languages_id . "'");
    Line 56:
    Code:
              $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from (" . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td ) where t.parent_id = '" . (int)$topic_links[$i] . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
    Line 61:
    Code:
          $topics_query = tep_db_query("select t.topics_id, td.topics_name, t.parent_id from (" . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td ) where t.parent_id = '" . (int)$current_topic_id . "' and t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' order by sort_order, td.topics_name");
    Line 100:
    Code:
        $topic_query = tep_db_query("select td.topics_name, td.topics_heading_title, td.topics_description from (" . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td ) where t.topics_id = '" . (int)$current_topic_id . "' and td.topics_id = '" . (int)$current_topic_id . "' and td.language_id = '" . (int)$languages_id . "'");
    Line 108:
    Code:
            $listing_sql = "select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad ) left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_status = '1' and au.authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "' and a.articles_id = a2t.articles_id and ad.articles_id = a2t.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' and a2t.topics_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' order by a.articles_date_added desc, ad.articles_name";
    Line 111:
    Code:
            $listing_sql = "select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad ) left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_status = '1' and au.authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "' and a.articles_id = a2t.articles_id and ad.articles_id = a2t.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' order by a.articles_date_added desc, ad.articles_name";
    Line 117:
    Code:
            $listing_sql = "select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad ) left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_status = '1' and a.articles_id = a2t.articles_id and ad.articles_id = a2t.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' and a2t.topics_id = '" . (int)$current_topic_id . "' and au.authors_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' order by a.articles_date_added desc, ad.articles_name";
    Line 120:
    Code:
            $listing_sql = "select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_DESCRIPTION . " ad ) left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_status = '1' and a.articles_id = a2t.articles_id and ad.articles_id = a2t.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' and a2t.topics_id = '" . (int)$current_topic_id . "' order by a.articles_date_added desc, ad.articles_name";
    Line 138:
    Code:
                   $author_query = tep_db_query("select au.authors_name, aui.authors_description, aui.authors_url from (" . TABLE_AUTHORS . " au, " . TABLE_AUTHORS_INFO . " aui ) where au.authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "' and au.authors_id = aui.authors_id and aui.languages_id = '" . (int)$languages_id . "'");
    Line 154:
    Code:
            $filterlist_sql = "select distinct t.topics_id as id, td.topics_name as name from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t, " . TABLE_TOPICS . " t, " . TABLE_TOPICS_DESCRIPTION . " td ) where a.articles_status = '1' and a.articles_id = a2t.articles_id and a2t.topics_id = t.topics_id and a2t.topics_id = td.topics_id and td.language_id = '" . (int)$languages_id . "' and a.authors_id = '" . (int)$HTTP_GET_VARS['authors_id'] . "' order by td.topics_name";
    Line 156:
    Code:
            $filterlist_sql= "select distinct au.authors_id as id, au.authors_name as name from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t, " . TABLE_AUTHORS . " au ) where a.articles_status = '1' and a.authors_id = au.authors_id and a.articles_id = a2t.articles_id and a2t.topics_id = '" . (int)$current_topic_id . "' order by au.authors_name";
    Line 246:
    Code:
      $articles_all_query_raw = "select a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t ) left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_DESCRIPTION . " ad where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' order by a.articles_date_added desc, ad.articles_name";
    Articles_new.tpl.php from /fallback (lines should match for an unmodified template)

    Line 17:
    Code:
      $articles_new_query_raw = "select a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t ) left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_DESCRIPTION . " ad where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY) order by a.articles_date_added desc, ad.articles_name";

  9. #9
    Active Member MindTwist's Avatar
    Join Date
    Jun 2007
    Location
    Barcelona, Spain
    Posts
    409
    Rep Power
    8


    Default Re: 1054 - Unknown column 'a.authors_id' in 'on clause'

    Quote Originally Posted by michael_s View Post
    Hey,

    I believe this is patched in SVN... You may want to grab the fileset. You could also try the articles update by JPF which is in a nice neat package for you (instead of fussing with SVN repository):

    219: Problems with Article not showing up when clicking on them - Bug Tracker - open source Commerce Maximized :: osCMax
    Oh well, I might have wasted some time then... I suppose I am using Article Manager 1.0. It seems to be working great now, so I am kinda afraid of updating it

    I did see a nice mod for being able to add page breaks to the articles (make them multi-page), I will be trying that one out.

  10. #10
    Active Member MindTwist's Avatar
    Join Date
    Jun 2007
    Location
    Barcelona, Spain
    Posts
    409
    Rep Power
    8


    Default Re: 1054 - Unknown column 'a.authors_id' in 'on clause'

    michael_s,
    For whatever reason, that didn't seem to solve it for me. I tried using the update you pointed me too, but the files on /template still seem to be giving me problems and I got the same 1054 error. When using the template I had changed, everything seemed to go ok

Page 1 of 3 123 LastLast

Similar Threads

  1. Error: 1054 - Unknown column
    By islander in forum osCmax v2 Installation issues
    Replies: 1
    Last Post: 02-27-2006, 11:31 AM
  2. 1054 - Unknown column 'p.vendors_product_price'
    By RoyceK in forum osCmax v2 Installation issues
    Replies: 1
    Last Post: 02-12-2006, 08:22 PM
  3. 1054 - Unknown column when restock product
    By DigitalPimp in forum osCmax v2 Customization/Mods
    Replies: 3
    Last Post: 07-25-2005, 02:57 PM
  4. 1054 - Unknown column 'popt.products_options_type
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 5
    Last Post: 03-08-2004, 01:47 AM
  5. 1054 - Unknown column - Help, please !
    By Anonymous in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 11-27-2002, 11:48 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
  •