Jump to content

Sort by for Category?


Recommended Posts

Hello guys,

I have few questions about query.

I like to sort data by 'position' (show categories by position)

$query = 'SELECT * 
        FROM `'._DB_PREFIX_.'category` 
        WHERE `id_parent` = '.$id_category.' AND `active` = '.$active.'
        ORDER BY `position` ASC';    
$results = Db::getInstance()->executeS($query);

Query is working, but not sorting by 'position' ; it's sorting by 'id'

Table: prefix_category

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...