Fatal error: Call to a member function setQuery() on a non-object in /home/p0oo9ip0o/public_html/plugins/content/botphp_content.php(53) : eval()'d code on line 4
I saw this fatal error when i use this
<?php $query = "SELECT title FROM #__categories WHERE id = ".intval($article->catid)." LIMIT 1";
$database->setQuery($query);
$category = $database->loadResult();
$custom_text = 'this '.$article->title.' belongs to'.$category;
$article->text = str_replace('{additionaltext}', $custom_text, $article->text); ?
You need to retrieve the Database Class Instance to the scope of your code. The event plugins execute in a local scope. (That is, global objects are not available).
$database =& JFactory::getDBO();
Place that before any code where you use $database.