osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

tep_get_category

This is a discussion on tep_get_category within the osCMax v1.7 Discussion forums, part of the osCMax v1.7 Forums category; how do I get all categories with parent _id not equal to 45 the function is thus: function tep_get_categories($categories_array = ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 03-15-2004, 05:09 AM
Active Member
 
Join Date: Aug 2003
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
jloyzaga
Default tep_get_category

how do I get all categories with parent _id not equal to 45

the function is thus:
function tep_get_categories($categories_array = '', $parent_id = '0 ', $indent = '') {
global $languages_id;

if (!is_array($categories_array)) $categories_array = array();

$categories_query = tep_db_query("select c.categories_id, cd.categories_name from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '" . (int)$parent_id . "' 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)) {
$categories_array[] = array('id' => $categories['categories_id'],
'text' => $indent . $categories['categories_name']);

if ($categories['categories_id'] != $parent_id) {
$categories_array = tep_get_categories($categories_array, $categories['categories_id'], $indent . '  ');
}
}

return $categories_array;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -8. The time now is 04:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax