Jump to content

Problem with While loop.


ram4nd

Recommended Posts

Here is a problem, the value should appear where it's commented, but it doesn't. I can post my model as-well, but i think it's unnecessary.

	function _categories_for_tutorial_boxes($last_category_id) {
	static $return, $category, $categories;
	$category = $this->model->get_category($last_category_id);
	echo $category->parent_id; //Shows value here
	while($category->parent_id <= 0) {
		echo $category->parent_id; //Doesn't show any value here
		$categories['name'][] = $category->name;
		$categories['url_name'][] = $category->url_name;
		$category = $this->model->get_category($category->parent_id);
	}

Link to comment
https://forums.phpfreaks.com/topic/192109-problem-with-while-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.