If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / Error page: 1054 Unknown column 'm.music_genre_id' in 'field list'

Error page: 1054 Unknown column 'm.music_genre_id' in 'field list'

Locked

Started by steely on 10 Jan 2007, 7:29 AM · Views: 1,873

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
10 Jan 2007, 7:29 AM
#1
steely avatar

steely

New Zenner

Join Date:
Jan 2007
Posts:
18
Plugin Contributions:
0

Post #1 by steely

I am working on 2 versions, vs 1.3.5. on one server and vs 1.3.6 on another, both Linux and the following error page appears in both versions, which may also be present in the new version.

Using Extras > adding Record Companies, then adding Product in Category and choosing/linking with specific Record Company,
if the products listed for a particular record company are all in the same category, the Filter Results by: which appears on the product page shows the scroll down with alpha/numeric selections.
However, when one clicks on one of these selections, the result is an error page:

1054 Unknown column 'm.music_genre_id' in 'field list'
in:
[select distinct m.music_genre_id as id, m.music_genre_name as name from products p, products_to_categories p2c, product_music_extra pme, record_company m where p.products_status = 1 and pme.record_company_id = m.record_company_id and p.products_id = p2c.products_id and p2c.categories_id = '0' order by m.record_company_name]

It doesn't happen with, for instance in category Hardware > Graphics Cards.

How can this be fixed?

thanks

I have no issues with self-importance, therefore, I do not have a signature with useless links blatantly advertising little of interest.

13 Jan 2007, 10:32 PM
#2
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,950
Plugin Contributions:
3

Post #2 by wilt

oops,

Looks like we have been doing a t bit of 'copy and paste' coding.

In includes/index_filters/record_company_filter.php

at around line 168 there is this query

      $filterlist_sql= "select distinct m.music_genre_id as id, m.music_genre_name as name
        from " . TABLE_PRODUCTS . " p, " .
        TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
        TABLE_PRODUCT_MUSIC_EXTRA . " pme, " .
        TABLE_RECORD_COMPANY . " m
        where p.products_status = 1
          and pme.record_company_id = m.record_company_id
          and p.products_id = p2c.products_id
          and p2c.categories_id = '" . (int)$current_category_id . "'
        order by m.record_company_name";

this should be

      $filterlist_sql= "select distinct m.record_company_id as id, m.record_company_name as name
        from " . TABLE_PRODUCTS . " p, " .
        TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
        TABLE_PRODUCT_MUSIC_EXTRA . " pme, " .
        TABLE_RECORD_COMPANY . " m
        where p.products_status = 1
          and pme.record_company_id = m.record_company_id
          and p.products_id = p2c.products_id
          and p2c.categories_id = '" . (int)$current_category_id . "'
        order by m.record_company_name";

HTH