kenb Posted April 1, 2007 Posted April 1, 2007 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!
vasttech Posted April 1, 2007 Posted April 1, 2007 "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). osCommerce Knowledge Base osCommerce Documentation Contributions
kenb Posted April 1, 2007 Author Posted April 1, 2007 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).
vasttech Posted April 1, 2007 Posted April 1, 2007 You can pull the current category id from the cPath in the URL. osCommerce Knowledge Base osCommerce Documentation Contributions
Recommended Posts
Archived
This topic is now archived and is closed to further replies.