Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to Extract categories_name Variable from Database?


kenb

Recommended Posts

Posted

How do I extract or fetch the categories_name variable from the database and set it to equal another variable such as $keywords to be used by PHP? I know this is a simple task, but I am not familiar with the database query side of osCommerce. Any help is greatly appreciated!

Posted

"select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where language_id = " . (int)$language_id . " and categories_id = '" . some_category_id_variable . "'";

 

That would be the query. You need to know the category id you are looking for. If you are trying to setup something like meta tags with category keywords, I would recommend the Header Tags Controller contribution (easy to install and gives you a lot of options for SEO).

Posted

Thanks, Jeff

 

What I'm trying to do is use the current category name as the keywords to pass to a script to display eBay auctions for those keywords (keyword phrase). Is there a way to get the current category? I tried using $category_name, which was not successful.

 

"select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where language_id = " . (int)$language_id . " and categories_id = '" . some_category_id_variable . "'";

 

That would be the query. You need to know the category id you are looking for. If you are trying to setup something like meta tags with category keywords, I would recommend the Header Tags Controller contribution (easy to install and gives you a lot of options for SEO).

Archived

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

×
×
  • Create New...