Jump to content

Catchable fatal error: Object of class Category could not be converted to string


laanes

Recommended Posts

Hi everyone,

 

I get this error:

 

Catchable fatal error: Object of class Category could not be converted to string

 

The code:

 

public static function list_all_cat_names() {
  	
  		$result_array = self::find_by_sql("SELECT name FROM ".self::$table_name);
  		return !empty($result_array) ? array_shift($result_array) : false;
  	
}


$categories = Category::find_all();

foreach ($categories as $cats):

echo $cats;

endforeach;

 

Where could be the problem?

 

 

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.