Getting the following the error :
Fatal error: Call to a member function load() on a non-object in C:\xampp\htdocs\Joomla15\components\com_book\book.php on line 43
Here is my php function :
function viewBook($option)
{
$id = JRequest::getVar('id', 0);
$row =& JTable::getInstance( 'book', 'Table');
$row->load($id);
if(!$row->type)
{
JError::raiseError( 404, JText::_('Invalid ID Provided'));
}
HTML_book::viewBook($row, $option);
}
Also, when i tried printing echo $row + ” “; , it returned 0!!
Thanks
Have you checked you actually have a Table class well named?
For example, if your table class is called BooksTableBook, your call to JTable::getInstance should be:
And if you’re using a recent version of PHP, you should remove the “&” from this line (it’s deprecated now):
I hope it helped!