3960AD Posted February 13, 2005 Share Posted February 13, 2005 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 More sharing options...
3960AD Posted February 13, 2005 Author Share Posted February 13, 2005 i got it working... :thumbsup: Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.