[eluser]macleodjb[/eluser]
Hi guys, I'm a little shaky with how i need to code this function now that i am using codeigniter, before i had a functions file which i would just include into the file i needed it in and just echo out what i needed at any time.
The function below is my old function and it would be placed into job_model.php. The functions its calling are functions that reside in Main_model.php. Obviously i'm getting an error with Main_model. Don't really know why, perhaps you can help.
Code:
function populate_subcat_array() {
$catnames = $this->Main_model->get_industry;
while ($industry = @mysql_fetch_array ($catnames, MYSQL_ASSOC)) {
echo "cats[" . $industry['cat_id'] . "] = new Array();\n";
$subcatnames = getsubcat($category['cat_id']);
while ($subcatname = @mysql_fetch_array ($subcatnames, MYSQL_ASSOC)) {
echo " cats[" . $category['cat_id'] . "] [" . $subcatname['cat_id'] . "] = '" . $subcatname['cat_name'] . "';\n";
}
}
}