[eluser]harry_singh[/eluser]
Hi Bargainph,
I wasnt clear for what i want to do... let me describe step by step
here is my database table
Code:
CREATE TABLE IF NOT EXISTS `article_category` (
`id` int(11) NOT NULL auto_increment,
`order_by` int(11) default '0',
`parent_id` int(11) NOT NULL default'0',
`title` varchar(50) default NULL,
`meta_description` varchar(255) default NULL,
`meta_keywords` varchar(255) default NULL,
`locked` tinyint(1) default '0',
`subcat` varchar(11) default NULL,
`item_counter` int(11) default '0',
`subcat_counter` int(11) default '0',
PRIMARY KEY `id` (`id`)
) ENGINE=MyISAM ;
In the application i want categories and subcategories , and option to change the display order of the categories but thats the later part. All i want is to show only parent categories first and when clicked on it the sub categories may show up
here is what m trying for my model
Code:
<?php
class Article_cat_model extends Model{
function Article_cat_model()
{
parent::Model();
}
function get_article_cats()
{
$query = $this->db->query('SELECT * FROM article_category WHERE parent_id = 0');
return ( $query->num_rows () > 0 );
}
}
?>
as i said earlier that i dont have knowledge of php so little help wud be great and just what i shud do in the models page and controller page ....