Jump to content

Help Changing PHP Code Output


gaspower

Recommended Posts

Hello,

 

I have the following code,

 

$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>";

            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
              $lc_text = $category_list . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>';
            } else {
		  $lc_text = $category_list . '<B><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a></B> ';
            }
            break;

 

and the output for this above code is,

 

Output1,Output1,Output1,Output1,Output1,Output1,Output1,Output1,

Brake Shoes For Cars

 

Having trouble getting the code to output it this way,

 

Brake Shoes For Cars

 

Fits: Output1,Output1,Output1,Output1,Output1,Output1,Output1,Output1,

 

 

Thanks for any help.

 

JR

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.