Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

DISPLAY CATEGORY NAME "PROBLEM"


mwo

Recommended Posts

Hi all.

 

I have been trying to install the "Display category name" tip that came with the OSCommerce documantation but have come across a problem.

 

When i try and open my home page, the main text area displays the following error:

 

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 'where categories_id = '' and language_id= '1'' at line 1

 

select categories_name fromcategories_description where categories_id = '' and language_id= '1'

 

[TEP STOP]

 

 

This is the new code i have installed and it works fine apart from what is showing on the home page:

 

catalog/include/classes/breadcrumb.php

 

//start of added code for category/ subcategory names

function last() {$trail_size=sizeof($this->_trail);return

 

$this->_trail[$trail_size-1]['title'];}

//end of added code

 

 

catalog/index.php

 

<td class="pageHeading"><?php echo $breadcrumb->last();?></td>

 

<td class="pageHeading"><?php echo $breadcrumb->last();?></td>

 

<td class="pageHeading"><?php echo HEADING_TITLE.''. tep_get_categories_name($cPath);?></td>

 

 

catalog/includes/functions/general.php

 

////

//TABLES: categories_description

function tep_get_categories_name($who_am_i){

global $languages_id;

$the_categories_name_query = tep_db_query("select categories_name from".

TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '".$who_am_i."'

and language_id= '".$languages_id. "'");

 

$the_categories_name = tep_db_fetch_array($the_categories_name_query);

return $the_categories_name['categories_name'];

}

 

Any help as to what i have done wrong would be greatly appreciated.

 

Thanks, mwo.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...