Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Category Repeating?


3960AD

Recommended Posts

Can anyone tell me why this code will repeat the first category(s) in the first section twice?? So in the example below, I get:

 

Showcase

-----------

Showcase

Movies

 

However, I'm simply trying to get

 

Showcase

------------

Movies

 

<?php

/* Return first category - Showcase */

 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.sort_order='1' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

 while ($categories = tep_db_fetch_array($categories_query)) {
 $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $categories['categories_id']) . '" target="_parent">' . $categories['categories_name'] . '</a>');

 }

 new contentBox($info_box_contents);  
?>

<?php

/* Return second category - Movies */

 $m_categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.sort_order='1' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

 while ($categories = tep_db_fetch_array($m_categories_query)) {
 $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $categories['categories_id']) . '" target="_parent">' . $categories['categories_name'] . '</a>');

 }

 new contentBox($info_box_contents);  
?>

 

Any suggestions?? Thanks!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...