Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

1054 error, Unknown column 'p.products_description


Nocturnaloner

Recommended Posts

Like the subject says, I have no idea why I'm getting this error when products_description is certainly in the database.

 

What I'm doing is hacking the Quick Price Updates 2.6 contrib to put in a Description column. Here's the relevant code chunk:

 

 if($HTTP_POST_VARS['product_new_description']){
                  foreach($HTTP_POST_VARS['product_new_description'] as $id => $new_description) {
                        if ($HTTP_POST_VARS['product_new_description'][$id] != $HTTP_POST_VARS['product_old_description'][$id]) {
                          $count_update++;
                          $item_updated[$id] = 'updated';
                          mysql_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . " SET products_description='" . $new_description . "' WHERE products_id=$id and language_id=" . $languages_id);
         mysql_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . " SET products_last_modified=now() WHERE products_id=$id");
                        }
                  }
               }

 

Oh, here is where the Description column should be getting made:

 

<?php if(DISPLAY_WEIGHT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_description ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . 'Description' . ' ' . TEXT_ASCENDINGLY)."</a>
                    <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_description DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . 'Description' . ' ' . TEXT_DESCENDINGLY)."</a>
                    <br>" . 'Description' . "</td>"; ?>

Link to comment
Share on other sites

try changing

 

p.products_description

to

pd.products_description

 

seems some people have it one way, others another... atleast that is what I have come across when tryng to help people with some querry issues

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

try changing

 

p.products_description

to

pd.products_description

 

seems some people have it one way, others another... atleast that is what I have come across when tryng to help people with some querry issues

 

Holy ! :D

 

I'm in shock! I can't remember the last time that somebody was actually able to answer a question of mine on this forum!!

 

It worked. You are teh awesome. Thank you, thank you.

 

Now if I could just get it to actually show a text field instead of an empty space...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...