i am having problem while saving data into database from a form.
whenever i try to save the data it shows the following error
Fatal error: Call to a member function bind() on a non-object in d:\wamp\www\Joomla\administrator\components\com_hello\admin.hello.php on line 49
save function definition is as follows.
function saveHello(){
global $mainframe;
$row =& JTable::getInstance('hello', 'Table');
if(!$row->bind(JRequest::get('post')))
{
JError::raiseError(500, $row->getError() );
}
$row->message = JRequest::getVar( 'message', '','post', 'string', JREQUEST_ALLOWRAW );
if(!$row->store()){
JError::raiseError(500, $row->getError() );
}
$mainframe->redirect('index.php?option=com_hello', 'Message Saved');
}
14 views still no reply!!!!!!!!!!
nybody pls help!
this code is not the original one that i hav used. this one is from a tutorial about saving data into the database.
saving data in database
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Forum rules
-
- Joomla! Apprentice
- Posts: 41
- Joined: Sat Dec 15, 2007 3:02 pm
- Location: Washington DC Metro
Re: saving data in database
The error would indicate that it expects $row to be an object, but it is not.
Have you included the tables subdirectory and related table file in your component?
Have you included the tables subdirectory and related table file in your component?
Denise