Jump to content

Help Adding Test To Output


gaspower

Recommended Posts

Hello,

Having trouble inserting plain text to the output of this php. The code below outputs categories in the database which pertain to certain products in this manner,

 

cat1, cat2, cat3, cat4, cat5 etc.

 

What I want to add is the text "Fits These Products" this to the output,

 

Fits These Products

cat1, cat2, cat3, cat4, cat5 etc

 

 $lc_align = '';
		if(isset($HTTP_GET_VARS['language']))
		{
		  $env_language = $HTTP_GET_VARS['language'];
		  $language_query = tep_db_query("select languages_id from ". TABLE_LANGUAGES . " where code ='" . $env_language . "'");
		  $language_arr = tep_db_fetch_array($language_query);
		  $language_id = $language_arr['languages_id'];
		}
		else
		{
	      $language_id = (int)$languages_id;
		}
	      $products_to_catagories_query = tep_db_query("SELECT categories_name FROM ". TABLE_PRODUCTS_TO_CATEGORIES ." p2c, ". TABLE_CATEGORIES_DESCRIPTION ." cd WHERE p2c.products_id = " . (int)$listing[$x]['products_id'] . " and p2c.categories_id = cd.categories_id and language_id ='".(int)$language_id."'");


$category_list = " ";
            do
              {
			if($category_list != " ")

				$category_list .=" , ";
			else
                   $products_to_categories_array = tep_db_fetch_array($products_to_catagories_query);
                $category_list .= $products_to_categories_array['categories_name'];
               }
            while($products_to_categories_array = tep_db_fetch_array($products_to_catagories_query));
	    $category_list .="<br><br>";

 

Thank you JR

Link to comment
https://forums.phpfreaks.com/topic/221759-help-adding-test-to-output/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.